Class: Koyomi::Period

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

Direct Known Subclasses

Calendar, Month, Week

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePeriod

——————–# instance methods



11
12
13
14
# File 'lib/koyomi/period.rb', line 11

def initialize
  super()
  self.created_at = Date.today
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object (private)

throw uniplemeted method to self range.



26
27
28
29
30
31
32
# File 'lib/koyomi/period.rb', line 26

def method_missing(name, *args, &block)
  begin
    self.range.__send__(name, *args, &block)
  rescue => e
    super
  end
end

Instance Attribute Details

#rangeObject

Returns the value of attribute range.



6
7
8
# File 'lib/koyomi/period.rb', line 6

def range
  @range
end