Class: Stattleship::Models::Team
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Stattleship::Models::Team
- Defined in:
- lib/stattleship/models/team.rb
Instance Method Summary collapse
- #color_css ⇒ Object
- #colors_css ⇒ Object
- #coordinates ⇒ Object
- #dump ⇒ Object
- #full_name ⇒ Object
- #hashtag_with_hash ⇒ Object
- #hashtags_with_hash ⇒ Object
- #league_abbreviation ⇒ Object
- #title ⇒ Object
Instance Method Details
#color_css ⇒ Object
18 19 20 |
# File 'lib/stattleship/models/team.rb', line 18 def color_css "##{color}" end |
#colors_css ⇒ Object
22 23 24 25 26 |
# File 'lib/stattleship/models/team.rb', line 22 def colors_css if colors colors.map { |c| "##{c}"} end end |
#coordinates ⇒ Object
56 57 58 |
# File 'lib/stattleship/models/team.rb', line 56 def coordinates [latitude, longitude] end |
#dump ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/stattleship/models/team.rb', line 38 def dump { full_name: full_name, title: title, color: color, colors: colors, hashtag: hashtag, hashtags: , league_abbreviation: league_abbreviation, location: location, latitude: latitude, longitude: longitude, name: name, nickname: nickname, slug: slug, } end |
#full_name ⇒ Object
4 5 6 |
# File 'lib/stattleship/models/team.rb', line 4 def full_name "#{location} #{nickname}" end |
#hashtag_with_hash ⇒ Object
28 29 30 |
# File 'lib/stattleship/models/team.rb', line 28 def hashtag_with_hash "##{hashtag}" end |
#hashtags_with_hash ⇒ Object
32 33 34 35 36 |
# File 'lib/stattleship/models/team.rb', line 32 def if .map { |c| "##{c}"} end end |
#league_abbreviation ⇒ Object
12 13 14 15 16 |
# File 'lib/stattleship/models/team.rb', line 12 def league_abbreviation if league league.abbreviation end end |
#title ⇒ Object
8 9 10 |
# File 'lib/stattleship/models/team.rb', line 8 def title "#{full_name} - #{league_abbreviation}" end |