Class: Pubid::Nist::Update

Inherits:
Core::Entity
  • Object
show all
Defined in:
lib/pubid/nist/update.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#monthObject

Returns the value of attribute month.



3
4
5
# File 'lib/pubid/nist/update.rb', line 3

def month
  @month
end

#numberObject

Returns the value of attribute number.



3
4
5
# File 'lib/pubid/nist/update.rb', line 3

def number
  @number
end

#yearObject

Returns the value of attribute year.



3
4
5
# File 'lib/pubid/nist/update.rb', line 3

def year
  @year
end