Class: Tetsujin::Theory::Interval

Inherits:
Object
  • Object
show all
Defined in:
lib/tetsujin/theory/interval.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value:) ⇒ Interval

Returns a new instance of Interval.

Parameters:

  • value (Integer)

    度数

Raises:

  • (TypeError)


8
9
10
11
# File 'lib/tetsujin/theory/interval.rb', line 8

def initialize(value:)
  raise TypeError unless value.is_a?(Integer)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



5
6
7
# File 'lib/tetsujin/theory/interval.rb', line 5

def value
  @value
end

Instance Method Details

#==(other) ⇒ Boolean

Parameters:

Returns:

  • (Boolean)


15
16
17
# File 'lib/tetsujin/theory/interval.rb', line 15

def ==(other)
  value == other.value
end