Class: Hour::Unit Private

Inherits:
Object
  • Object
show all
Defined in:
lib/hour.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Abstract time unit class.

Subclasses are decorating the ‘Hour` class with functionality specific for their particular type (hours, minutes and seconds).

Direct Known Subclasses

HourUnit, MinuteUnit, SecondUnit

Instance Method Summary collapse

Constructor Details

#initialize(hour) ⇒ Unit

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Unit.



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

def initialize(hour)
  @hour = hour
end

Instance Method Details

#valueObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Raises:

  • (NotImplementedError)


11
12
13
# File 'lib/hour.rb', line 11

def value
  raise NotImplementedError.new("Override in subclasses.")
end