class Dimensional::Enum::Attribute

Public Class Methods

new( enum_attr_key, enum_attribute ) click to toggle source
# File lib/dimensional/enum/attribute.rb, line 7
def initialize( enum_attr_key, enum_attribute )
  @enum_attr_key  = enum_attr_key
  @enum_attribute = enum_attribute
end

Public Instance Methods

<=>( other ) click to toggle source
# File lib/dimensional/enum/attribute.rb, line 16
def <=>( other )
  to_s <=> other
end
==( other ) click to toggle source
# File lib/dimensional/enum/attribute.rb, line 12
def ==( other )
  to_s == other
end
id() click to toggle source
# File lib/dimensional/enum/attribute.rb, line 20
def id
  @enum_attribute[label][:id]
rescue
  nil
end
Also aliased as: value
label() click to toggle source
# File lib/dimensional/enum/attribute.rb, line 32
def label
  @enum_attr_key.to_sym
rescue
  nil
end
method_missing( method, *args, &block ) click to toggle source
Calls superclass method
# File lib/dimensional/enum/attribute.rb, line 56
def method_missing( method, *args, &block )
  if @enum_attribute[label].has_key? method
    return @enum_attribute[label][method]
  end
  super
end
name() click to toggle source
# File lib/dimensional/enum/attribute.rb, line 26
def name
  @enum_attribute[label][:name]
rescue
  nil
end
to_i() click to toggle source
# File lib/dimensional/enum/attribute.rb, line 50
def to_i
  id.to_i
end
to_s() click to toggle source
# File lib/dimensional/enum/attribute.rb, line 42
def to_s
  to_str
end
to_str() click to toggle source
# File lib/dimensional/enum/attribute.rb, line 38
def to_str
  label.to_s
end
to_sym() click to toggle source
# File lib/dimensional/enum/attribute.rb, line 46
def to_sym
  label.to_sym
end
value()
Alias for: id