Class: Sports::Club
Overview
more attribs - todo/fix - also add “upstream” to struct & model!!!!!
district, geos, year_end, country, etc.
Constant Summary
Constants included from SportDb::NameHelper
SportDb::NameHelper::LANG_RE, SportDb::NameHelper::NORM_RE, SportDb::NameHelper::YEAR_RE
Instance Attribute Summary collapse
-
#a ⇒ Object
Returns the value of attribute a.
-
#b ⇒ Object
Returns the value of attribute b.
- #city ⇒ Object
- #district ⇒ Object
- #geos ⇒ Object
-
#ground ⇒ Object
Returns the value of attribute ground.
Attributes inherited from Team
#alt_names, #alt_names_auto, #code, #key, #name, #wikipedia, #year, #year_end
Instance Method Summary collapse
-
#a? ⇒ Boolean
is a (1st) team / club (i)? if a is NOT set.
-
#b? ⇒ Boolean
is b (2nd/reserve/jr) team / club (ii) if a is set.
- #country ⇒ Object
-
#initialize(**kwargs) ⇒ Club
constructor
A new instance of Club.
- #update(**kwargs) ⇒ Object
Methods inherited from Team
#add_variants, #duplicates, #duplicates?, #historic?, #names, #wikipedia?, #wikipedia_url
Methods included from SportDb::NameHelper
#has_lang?, #has_year?, #normalize, #sanitize, #strip_lang, #strip_norm, #strip_year, #variants
Constructor Details
#initialize(**kwargs) ⇒ Club
Returns a new instance of Club.
133 134 135 |
# File 'lib/sports/structs/team.rb', line 133 def initialize( **kwargs ) super end |
Instance Attribute Details
#a ⇒ Object
Returns the value of attribute a.
121 122 123 |
# File 'lib/sports/structs/team.rb', line 121 def a @a end |
#b ⇒ Object
Returns the value of attribute b.
121 122 123 |
# File 'lib/sports/structs/team.rb', line 121 def b @b end |
#city ⇒ Object
127 |
# File 'lib/sports/structs/team.rb', line 127 def city() @a == nil ? @city : @a.city; end |
#district ⇒ Object
128 |
# File 'lib/sports/structs/team.rb', line 128 def district() @a == nil ? @district : @a.district; end |
#geos ⇒ Object
130 |
# File 'lib/sports/structs/team.rb', line 130 def geos() @a == nil ? @geos : @a.geos; end |
#ground ⇒ Object
Returns the value of attribute ground.
119 120 121 |
# File 'lib/sports/structs/team.rb', line 119 def ground @ground end |
Instance Method Details
#a? ⇒ Boolean
is a (1st) team / club (i)? if a is NOT set
122 |
# File 'lib/sports/structs/team.rb', line 122 def a?() @a == nil; end |
#b? ⇒ Boolean
is b (2nd/reserve/jr) team / club (ii) if a is set
123 |
# File 'lib/sports/structs/team.rb', line 123 def b?() @a != nil; end |
#country ⇒ Object
129 |
# File 'lib/sports/structs/team.rb', line 129 def country() @a == nil ? @country : @a.country; end |
#update(**kwargs) ⇒ Object
137 138 139 140 141 142 143 144 |
# File 'lib/sports/structs/team.rb', line 137 def update( **kwargs ) super @city = kwargs[:city] if kwargs.has_key? :city ## todo/fix: use city struct - why? why not? ## todo/fix: add country too or report unused keywords / attributes - why? why not? self ## note - MUST return self for chaining end |