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.



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

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.



65
66
67
# File 'lib/grizzled/string/template.rb', line 65

def default
  @default
end

#iendObject (readonly)

Returns the value of attribute iend.



65
66
67
# File 'lib/grizzled/string/template.rb', line 65

def iend
  @iend
end

#istartObject (readonly)

Returns the value of attribute istart.



65
66
67
# File 'lib/grizzled/string/template.rb', line 65

def istart
  @istart
end

#nameObject (readonly)

Returns the value of attribute name.



65
66
67
# File 'lib/grizzled/string/template.rb', line 65

def name
  @name
end

Instance Method Details

#inspectObject



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

alias :inspect :to_s

#to_sObject



75
76
77
# File 'lib/grizzled/string/template.rb', line 75

def to_s
  "#{name}"
end