Class: Grizzled::String::Template::Variable

Inherits:
Object
  • Object
show all
Defined in:
lib/grizzled/string/template.rb

Overview

What a parsed variable looks like.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#defaultObject (readonly)

Returns the value of attribute default.



59
60
61
# File 'lib/grizzled/string/template.rb', line 59

def default
  @default
end

#iendObject (readonly)

Returns the value of attribute iend.



59
60
61
# File 'lib/grizzled/string/template.rb', line 59

def iend
  @iend
end

#istartObject (readonly)

Returns the value of attribute istart.



59
60
61
# File 'lib/grizzled/string/template.rb', line 59

def istart
  @istart
end

#nameObject (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

#inspectObject



68
# File 'lib/grizzled/string/template.rb', line 68

alias :inspect :to_s

#to_sObject



69
70
71
# File 'lib/grizzled/string/template.rb', line 69

def to_s
  "#{name}"
end