Class Chronos::Calendar::Gregorian
In: lib/chronos/calendar/gregorian.rb
Parent: ::Chronos::Calendar

Methods

Constants

Inspect = "#<%s %s>".freeze

Public Class methods

[Source]

    # File lib/chronos/calendar/gregorian.rb, line 22
22:         def method_missing(*args, &block)
23:           new(Chronos::Datetime::Gregorian.send(*args, &block))
24:         end

[Source]

    # File lib/chronos/calendar/gregorian.rb, line 27
27:       def initialize(datetime)
28:         @datetime = datetime
29:         @language = datetime.language
30:       end

Public Instance methods

[Source]

    # File lib/chronos/calendar/gregorian.rb, line 44
44:       def day=(value)
45:         @datetime += Chronos::Duration::Gregorian.new((value-@datetime.day())*Chronos::PS_IN_DAY, 0, @language)
46:       end

[Source]

    # File lib/chronos/calendar/gregorian.rb, line 48
48:       def hour=(value)
49:         @datetime += Chronos::Duration::Gregorian.new((value-@datetime.hour())*Chronos::PS_IN_HOUR, 0, @language)
50:       end

[Source]

    # File lib/chronos/calendar/gregorian.rb, line 86
86:       def inspect
87:         sprintf Inspect,
88:           self.class,
89:           @datetime
90:         # /sprintf
91:       end

[Source]

    # File lib/chronos/calendar/gregorian.rb, line 76
76:       def method_missing(*args, &block)
77:         r = @datetime.send(*args, &block)
78:         if r.class == ::Chronos::Datetime::Gregorian then
79:           @datetime = r
80:           self
81:         else
82:           r
83:         end
84:       end

[Source]

    # File lib/chronos/calendar/gregorian.rb, line 64
64:       def microsecond=(value)
65:         @datetime += Chronos::Duration::Gregorian.new((value-@datetime.microsecond())*Chronos::PS_IN_MICROSECOND, 0, @language)
66:       end

[Source]

    # File lib/chronos/calendar/gregorian.rb, line 60
60:       def millisecond=(value)
61:         @datetime += Chronos::Duration::Gregorian.new((value-@datetime.millisecond())*Chronos::PS_IN_MILLISECOND, 0, @language)
62:       end

[Source]

    # File lib/chronos/calendar/gregorian.rb, line 52
52:       def minute=(value)
53:         @datetime += Chronos::Duration::Gregorian.new((value-@datetime.minute())*Chronos::PS_IN_MINUTE, 0, @language)
54:       end

[Source]

    # File lib/chronos/calendar/gregorian.rb, line 36
36:       def month=(value)
37:         @datetime += Chronos::Duration::Gregorian.new(0, (value-@datetime.month()), @language)
38:       end

[Source]

    # File lib/chronos/calendar/gregorian.rb, line 68
68:       def nanosecond=(value)
69:         @datetime += Chronos::Duration::Gregorian.new((value-@datetime.nanosecond())*Chronos::PS_IN_NANOSECOND, 0, @language)
70:       end

[Source]

    # File lib/chronos/calendar/gregorian.rb, line 72
72:       def picosecond=(value)
73:         @datetime += Chronos::Duration::Gregorian.new((value-@datetime.picosecond())*Chronos::PS_IN_PICOSECOND, 0, @language)
74:       end

[Source]

    # File lib/chronos/calendar/gregorian.rb, line 56
56:       def second=(value)
57:         @datetime += Chronos::Duration::Gregorian.new((value-@datetime.second())*Chronos::PS_IN_SECOND, 0, @language)
58:       end

[Source]

    # File lib/chronos/calendar/gregorian.rb, line 40
40:       def week=(value)
41:         @datetime += Chronos::Duration::Gregorian.new((value-@datetime.week())*Chronos::PS_IN_WEEK, 0, @language)
42:       end

[Source]

    # File lib/chronos/calendar/gregorian.rb, line 32
32:       def year=(value)
33:         @datetime += Chronos::Duration::Gregorian.new(0, (value-@datetime.year())*12, @language)
34:       end

[Validate]