Class: Mtrc::Sample

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/mtrc/sample.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, value) ⇒ Sample

Returns a new instance of Sample.



16
17
18
19
# File 'lib/mtrc/sample.rb', line 16

def initialize(key, value)
  @key = key
  @value = value
end

Instance Attribute Details

#keyObject

Returns the value of attribute key.



14
15
16
# File 'lib/mtrc/sample.rb', line 14

def key
  @key
end

#valueObject

Returns the value of attribute value.



15
16
17
# File 'lib/mtrc/sample.rb', line 15

def value
  @value
end

Instance Method Details

#<=>(o) ⇒ Object



21
22
23
# File 'lib/mtrc/sample.rb', line 21

def <=>(o)
  self.key <=> o.key
end