Class: Official

Inherits:
Object
  • Object
show all
Defined in:
lib/fbtxt-pp/models/officials.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, country: nil, type: nil) ⇒ Official

Returns a new instance of Official.



19
20
21
22
23
24
25
# File 'lib/fbtxt-pp/models/officials.rb', line 19

def initialize( name:,
                country: nil,
                type:    nil )
   @name    = name
   @country = country
   @type    = type
end

Instance Attribute Details

#countryObject (readonly)

Returns the value of attribute country.



16
17
18
# File 'lib/fbtxt-pp/models/officials.rb', line 16

def country
  @country
end

#nameObject (readonly)

Returns the value of attribute name.



16
17
18
# File 'lib/fbtxt-pp/models/officials.rb', line 16

def name
  @name
end

#typeObject (readonly)

Returns the value of attribute type.



16
17
18
# File 'lib/fbtxt-pp/models/officials.rb', line 16

def type
  @type
end

Class Method Details

.build(h) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/fbtxt-pp/models/officials.rb', line 8

def self.build( h )
   new(
         name:        h['name'],
         country:     h['country'],
         type:        h['type']
   )
end