Class: WAG::Label
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(value) ⇒ Label
constructor
A new instance of Label.
- #to_sexpr ⇒ Object
Methods included from Encodable
Constructor Details
#initialize(value) ⇒ Label
Returns a new instance of Label.
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/wag/label.rb', line 9 def initialize(value) if value.is_a?(Integer) @value = value.to_i else value = value.to_s @value = if value.start_with?('$') value.to_sym else "$#{value}".to_sym end end end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
7 8 9 |
# File 'lib/wag/label.rb', line 7 def value @value end |
Class Method Details
Instance Method Details
#to_sexpr ⇒ Object
22 23 24 |
# File 'lib/wag/label.rb', line 22 def to_sexpr value end |