Class: Rucc::Kind
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Class Method Summary collapse
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(id, name) ⇒ Kind
constructor
A new instance of Kind.
- #to_s ⇒ Object
Constructor Details
#initialize(id, name) ⇒ Kind
Returns a new instance of Kind.
11 12 13 14 |
# File 'lib/rucc/kind.rb', line 11 def initialize(id, name) @id = id # Used only for <=> @name = name end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
15 16 17 |
# File 'lib/rucc/kind.rb', line 15 def id @id end |
Class Method Details
.def_kind(name, id) ⇒ Object
6 7 8 |
# File 'lib/rucc/kind.rb', line 6 def def_kind(name, id) const_set(name, self.new(id, name)) end |
Instance Method Details
#<=>(other) ⇒ Object
17 18 19 |
# File 'lib/rucc/kind.rb', line 17 def <=>(other) @id <=> other.id end |
#to_s ⇒ Object
21 22 23 |
# File 'lib/rucc/kind.rb', line 21 def to_s @name.to_s end |