Class: SourceMap::Mapping
- Defined in:
- opal/stdlib/source_map/mapping.rb
Instance Attribute Summary collapse
-
#generated ⇒ Object
Returns the value of attribute generated.
-
#name ⇒ Object
Returns the value of attribute name.
-
#original ⇒ Object
Returns the value of attribute original.
-
#source ⇒ Object
Returns the value of attribute source.
Instance Method Summary collapse
-
#inspect ⇒ Object
Public: Get a pretty inspect output for debugging purposes.
-
#to_s ⇒ Object
Public: Get a simple string representation of the mapping.
Methods inherited from Struct
Constructor Details
This class inherits a constructor from Struct
Instance Attribute Details
#generated ⇒ Object
Returns the value of attribute generated
Returns:
-
(Object )
—
the current value of generated
4 5 6
# File 'opal/stdlib/source_map/mapping.rb', line 4 def generated @generated end
#name ⇒ Object
Returns the value of attribute name
Returns:
-
(Object )
—
the current value of name
4 5 6
# File 'opal/stdlib/source_map/mapping.rb', line 4 def name @name end
Instance Method Details
#inspect ⇒ Object
Public: Get a pretty inspect output for debugging purposes.
Returns a String.
18 19 20 21 22 23 24
# File 'opal/stdlib/source_map/mapping.rb', line 18 def inspect str = "#<#{self.class} source=#{source.inspect}" str << " generated=#{generated}, original=#{original}" str << " name=#{name.inspect}" if name str << ">" str end
#to_s ⇒ Object
Public: Get a simple string representation of the mapping.
Returns a String.
8 9 10 11 12 13
# File 'opal/stdlib/source_map/mapping.rb', line 8 def to_s str = "#{generated.line}:#{generated.column}" str << "->#{source}@#{original.line}:#{original.column}" str << "##{name}" if name str end