Class: Germinate::Variable
- Inherits:
-
String
- Object
- String
- Germinate::Variable
- Defined in:
- lib/germinate/variable.rb
Instance Attribute Summary collapse
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#origin ⇒ Object
readonly
Returns the value of attribute origin.
Instance Method Summary collapse
-
#initialize(name, value, line, source_path, line_number) ⇒ Variable
constructor
A new instance of Variable.
- #update_source_line!(comment_prefix) ⇒ Object
Constructor Details
#initialize(name, value, line, source_path, line_number) ⇒ Variable
Returns a new instance of Variable.
6 7 8 9 10 11 |
# File 'lib/germinate/variable.rb', line 6 def initialize(name, value, line, source_path, line_number) super(value.to_s) @name = name @line = line @origin = Germinate::Origin.new(source_path, line_number) end |
Instance Attribute Details
#line ⇒ Object (readonly)
Returns the value of attribute line.
4 5 6 |
# File 'lib/germinate/variable.rb', line 4 def line @line end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
2 3 4 |
# File 'lib/germinate/variable.rb', line 2 def name @name end |
#origin ⇒ Object (readonly)
Returns the value of attribute origin.
3 4 5 |
# File 'lib/germinate/variable.rb', line 3 def origin @origin end |
Instance Method Details
#update_source_line!(comment_prefix) ⇒ Object
13 14 15 |
# File 'lib/germinate/variable.rb', line 13 def update_source_line!(comment_prefix) line.replace(make_control_line(comment_prefix)) end |