Class: Pubid::Nist::Update
- Inherits:
-
Core::Entity
- Object
- Core::Entity
- Pubid::Nist::Update
- Defined in:
- lib/pubid/nist/update.rb
Instance Attribute Summary collapse
-
#month ⇒ Object
Returns the value of attribute month.
-
#number ⇒ Object
Returns the value of attribute number.
-
#year ⇒ Object
Returns the value of attribute year.
Instance Method Summary collapse
-
#initialize(number: nil, year: nil, month: nil) ⇒ Update
constructor
A new instance of Update.
Constructor Details
#initialize(number: nil, year: nil, month: nil) ⇒ Update
Returns a new instance of Update.
5 6 7 8 9 10 11 12 13 |
# File 'lib/pubid/nist/update.rb', line 5 def initialize(number: nil, year: nil, month: nil) @number = number || 1 @year = year&.to_s&.length == 2 ? "19#{year}" : year if month date = Date.parse("01/#{month}/#{@year}") @month = date.month end end |
Instance Attribute Details
#month ⇒ Object
Returns the value of attribute month.
3 4 5 |
# File 'lib/pubid/nist/update.rb', line 3 def month @month end |
#number ⇒ Object
Returns the value of attribute number.
3 4 5 |
# File 'lib/pubid/nist/update.rb', line 3 def number @number end |
#year ⇒ Object
Returns the value of attribute year.
3 4 5 |
# File 'lib/pubid/nist/update.rb', line 3 def year @year end |