Class: Sports::League

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key:, name:, alt_names: [], alt_names_auto: [], country: nil, intl: false, clubs: true) ⇒ League

Returns a new instance of League.



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/sports/structs/league.rb', line 12

def initialize( key:, name:, alt_names: [], alt_names_auto: [],
                country: nil, intl: false, clubs: true )
  @key            = key
  @name           = name
  @alt_names      = alt_names
  @alt_names_auto = alt_names_auto

  @country        = country
  @intl           = intl
  @clubs          = clubs
end

Instance Attribute Details

#alt_namesObject

Returns the value of attribute alt_names.



7
8
9
# File 'lib/sports/structs/league.rb', line 7

def alt_names
  @alt_names
end

#alt_names_autoObject

special import only attribs



10
11
12
# File 'lib/sports/structs/league.rb', line 10

def alt_names_auto
  @alt_names_auto
end

#countryObject (readonly)

Returns the value of attribute country.



6
7
8
# File 'lib/sports/structs/league.rb', line 6

def country
  @country
end

#intlObject (readonly)

Returns the value of attribute intl.



6
7
8
# File 'lib/sports/structs/league.rb', line 6

def intl
  @intl
end

#keyObject (readonly)

Returns the value of attribute key.



6
7
8
# File 'lib/sports/structs/league.rb', line 6

def key
  @key
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/sports/structs/league.rb', line 6

def name
  @name
end

Instance Method Details

#clubs?Boolean Also known as: club?

Returns:

  • (Boolean)


28
# File 'lib/sports/structs/league.rb', line 28

def clubs?()            @clubs == true; end

#intl?Boolean

Returns:

  • (Boolean)


24
# File 'lib/sports/structs/league.rb', line 24

def intl?()      @intl == true; end

#national?Boolean Also known as: domestic?

Returns:

  • (Boolean)


25
# File 'lib/sports/structs/league.rb', line 25

def national?()  @intl == false; end

#national_teams?Boolean Also known as: national_team?

Returns:

  • (Boolean)


29
# File 'lib/sports/structs/league.rb', line 29

def national_teams?()   @clubs == false; end