Class: Kisaweb::Club

Inherits:
Base show all
Defined in:
lib/kisaweb/club.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#abbreviationObject

Returns the value of attribute abbreviation.



3
4
5
# File 'lib/kisaweb/club.rb', line 3

def abbreviation
  @abbreviation
end

#areaObject

Returns the value of attribute area.



3
4
5
# File 'lib/kisaweb/club.rb', line 3

def area
  @area
end

#contact_emailObject

Returns the value of attribute contact_email.



3
4
5
# File 'lib/kisaweb/club.rb', line 3

def contact_email
  @contact_email
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/kisaweb/club.rb', line 3

def name
  @name
end

#reference_numberObject

Returns the value of attribute reference_number.



3
4
5
# File 'lib/kisaweb/club.rb', line 3

def reference_number
  @reference_number
end

#urlObject

Returns the value of attribute url.



3
4
5
# File 'lib/kisaweb/club.rb', line 3

def url
  @url
end

Class Method Details

.allObject



6
7
8
# File 'lib/kisaweb/club.rb', line 6

def self.all
  @@all ||= find_all
end

.find(abbr) ⇒ Object



10
11
12
13
14
# File 'lib/kisaweb/club.rb', line 10

def self.find(abbr)
  all.select do |club|
    club.abbreviation.to_s.downcase == abbr.to_s.downcase
  end.first
end

.from_csv_array(arr) ⇒ Object



16
17
18
19
20
21
22
23
24
25
# File 'lib/kisaweb/club.rb', line 16

def self.from_csv_array(arr)
  club = new
  club.abbreviation = arr[0]
  club.name = arr[1]
  club.area = arr[2]
  club.url = arr[3]
  club.contact_email = arr[4]
  club.reference_number = arr[8]
  club
end

Instance Method Details

#attributesObject



27
28
29
30
31
32
33
34
35
36
# File 'lib/kisaweb/club.rb', line 27

def attributes
  {
    :abbreviation => abbreviation,
    :name => name,
    :area => area,
    :url => url,
    :contact_email => contact_email,
    :reference_number => reference_number
  }
end