Class: Infostrada::Referee
- Inherits:
-
Object
- Object
- Infostrada::Referee
- Defined in:
- lib/infostrada/referee.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#nation ⇒ Object
Returns the value of attribute nation.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(hash = {}, &block) ⇒ Referee
constructor
A new instance of Referee.
Constructor Details
#initialize(hash = {}, &block) ⇒ Referee
Returns a new instance of Referee.
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/infostrada/referee.rb', line 13 def initialize(hash = {}, &block) @id = hash.delete('n_RefereeID') @name = hash.delete('c_Referee') @nation = Nation.new(hash, 'referee') block.call(self) if block_given? self end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/infostrada/referee.rb', line 3 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/infostrada/referee.rb', line 3 def name @name end |
#nation ⇒ Object
Returns the value of attribute nation.
3 4 5 |
# File 'lib/infostrada/referee.rb', line 3 def nation @nation end |
Class Method Details
.from_json(json = {}) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/infostrada/referee.rb', line 5 def self.from_json(json = {}) self.new do |referee| referee.id = json['id'] referee.name = json['name'] referee.nation = json['nation'] end end |