class Quarter::Constant

Public Class Methods

new(number) click to toggle source
# File lib/quarter.rb, line 195
def initialize(number)
  @number = number
end

Public Instance Methods

-(other) click to toggle source
# File lib/quarter.rb, line 199
def -(other)
  raise ArgumentError unless other.kind_of?(Integer)

  Quarter.new(other, @number)
end
/(other) click to toggle source
# File lib/quarter.rb, line 205
def /(other)
  raise ArgumentError unless other.kind_of?(Integer)

  Quarter.new(other, @number)
end
coerce(other) click to toggle source
# File lib/quarter.rb, line 211
def coerce(other)
  unless other.kind_of?(Integer)
    raise TypeError, "#{self.class} can't be coerced with #{other.class}"
  end

  return self, other
end