class WAG::Label

Attributes

value[R]

Public Class Methods

from(value) click to toggle source
# File lib/wag/label.rb, line 26
def self.from(value)
  return value if value.is_a?(WAG::Label)

  WAG::Label.new(value)
end
new(value) click to toggle source
# 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

Public Instance Methods

to_sexpr() click to toggle source
# File lib/wag/label.rb, line 22
def to_sexpr
  value
end