Class: Fbtxt::Model::Referee

Inherits:
Object
  • Object
show all
Defined in:
lib/fbtxt/document/models/referee.rb

Overview

rename to/use Official - why? why not?

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, country: nil) ⇒ Referee

Returns a new instance of Referee.



9
10
11
12
# File 'lib/fbtxt/document/models/referee.rb', line 9

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

Instance Attribute Details

#countryObject (readonly)

Returns the value of attribute country.



7
8
9
# File 'lib/fbtxt/document/models/referee.rb', line 7

def country
  @country
end

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/fbtxt/document/models/referee.rb', line 7

def name
  @name
end

Instance Method Details

#as_jsonObject



14
15
16
17
18
19
# File 'lib/fbtxt/document/models/referee.rb', line 14

def as_json(*)
    h = { 'name' => name }
    h['country'] = country    if country

    h
end