Class: Grizzled::String::Template::Variable
- Inherits:
-
Object
- Object
- Grizzled::String::Template::Variable
- Defined in:
- lib/grizzled/string/template.rb
Overview
What a parsed variable looks like.
Instance Attribute Summary collapse
-
#default ⇒ Object
readonly
Returns the value of attribute default.
-
#iend ⇒ Object
readonly
Returns the value of attribute iend.
-
#istart ⇒ Object
readonly
Returns the value of attribute istart.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(istart, iend, name, default = nil) ⇒ Variable
constructor
A new instance of Variable.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(istart, iend, name, default = nil) ⇒ Variable
Returns a new instance of Variable.
61 62 63 64 65 66 |
# File 'lib/grizzled/string/template.rb', line 61 def initialize(istart, iend, name, default=nil) @istart = istart @iend = iend @name = name @default = default end |
Instance Attribute Details
#default ⇒ Object (readonly)
Returns the value of attribute default.
59 60 61 |
# File 'lib/grizzled/string/template.rb', line 59 def default @default end |
#iend ⇒ Object (readonly)
Returns the value of attribute iend.
59 60 61 |
# File 'lib/grizzled/string/template.rb', line 59 def iend @iend end |
#istart ⇒ Object (readonly)
Returns the value of attribute istart.
59 60 61 |
# File 'lib/grizzled/string/template.rb', line 59 def istart @istart end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
59 60 61 |
# File 'lib/grizzled/string/template.rb', line 59 def name @name end |
Instance Method Details
#inspect ⇒ Object
68 |
# File 'lib/grizzled/string/template.rb', line 68 alias :inspect :to_s |
#to_s ⇒ Object
69 70 71 |
# File 'lib/grizzled/string/template.rb', line 69 def to_s "#{name}" end |