Class: Sports::Club

Inherits:
Team
  • Object
show all
Defined in:
lib/sports/structs/team.rb

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

Attributes inherited from Team

#alt_names, #alt_names_auto, #code, #key, #name, #wikipedia, #year, #year_end

Instance Method Summary collapse

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

#aObject

Returns the value of attribute a.



121
122
123
# File 'lib/sports/structs/team.rb', line 121

def a
  @a
end

#bObject

Returns the value of attribute b.



121
122
123
# File 'lib/sports/structs/team.rb', line 121

def b
  @b
end

#cityObject



127
# File 'lib/sports/structs/team.rb', line 127

def city()      @a == nil ?  @city     : @a.city;     end

#districtObject



128
# File 'lib/sports/structs/team.rb', line 128

def district()  @a == nil ?  @district : @a.district; end

#geosObject



130
# File 'lib/sports/structs/team.rb', line 130

def geos()      @a == nil ?  @geos     : @a.geos;     end

#groundObject

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

Returns:

  • (Boolean)


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

Returns:

  • (Boolean)


123
# File 'lib/sports/structs/team.rb', line 123

def b?()  @a != nil; end

#countryObject



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