Class: HolidaysRest::Language

Inherits:
Data
  • Object
show all
Defined in:
lib/holidays_rest/models.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code

Returns:

  • (Object)

    the current value of code



47
48
49
# File 'lib/holidays_rest/models.rb', line 47

def code
  @code
end

#nameObject (readonly)

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



47
48
49
# File 'lib/holidays_rest/models.rb', line 47

def name
  @name
end

Class Method Details

.from_hash(h) ⇒ Object



48
49
50
# File 'lib/holidays_rest/models.rb', line 48

def self.from_hash(h)
  new(code: h.fetch("code", ""), name: h.fetch("name", ""))
end