Class: Seatsio::Month
- Inherits:
-
Object
- Object
- Seatsio::Month
- Defined in:
- lib/seatsio/domain.rb
Instance Attribute Summary collapse
-
#month ⇒ Object
readonly
Returns the value of attribute month.
-
#year ⇒ Object
readonly
Returns the value of attribute year.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(year, month) ⇒ Month
constructor
A new instance of Month.
- #serialize ⇒ Object
Constructor Details
#initialize(year, month) ⇒ Month
Returns a new instance of Month.
466 467 468 469 |
# File 'lib/seatsio/domain.rb', line 466 def initialize(year, month) @year = year @month = month end |
Instance Attribute Details
#month ⇒ Object (readonly)
Returns the value of attribute month.
458 459 460 |
# File 'lib/seatsio/domain.rb', line 458 def month @month end |
#year ⇒ Object (readonly)
Returns the value of attribute year.
458 459 460 |
# File 'lib/seatsio/domain.rb', line 458 def year @year end |
Class Method Details
.from_json(data) ⇒ Object
460 461 462 463 464 |
# File 'lib/seatsio/domain.rb', line 460 def self.from_json(data) @year = data['year'] @month = data['month'] self end |
Instance Method Details
#serialize ⇒ Object
471 472 473 |
# File 'lib/seatsio/domain.rb', line 471 def serialize @year.to_s + "-" + @month.to_s.rjust(2, "0") end |