Class: Kisaweb::Contest
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#date ⇒ Object
Returns the value of attribute date.
-
#organizer ⇒ Object
Returns the value of attribute organizer.
-
#title ⇒ Object
Returns the value of attribute title.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
3 4 5 |
# File 'lib/kisaweb/contest.rb', line 3 def code @code end |
#date ⇒ Object
Returns the value of attribute date.
3 4 5 |
# File 'lib/kisaweb/contest.rb', line 3 def date @date end |
#organizer ⇒ Object
Returns the value of attribute organizer.
3 4 5 |
# File 'lib/kisaweb/contest.rb', line 3 def organizer @organizer end |
#title ⇒ Object
Returns the value of attribute title.
3 4 5 |
# File 'lib/kisaweb/contest.rb', line 3 def title @title end |
Class Method Details
.all ⇒ Object
11 12 13 |
# File 'lib/kisaweb/contest.rb', line 11 def self.all @@all ||= find_all end |
.find(code) ⇒ Object
5 6 7 8 9 |
# File 'lib/kisaweb/contest.rb', line 5 def self.find(code) all.select do |contest| contest.code == code end.first end |
.from_csv_array(arr) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/kisaweb/contest.rb', line 15 def self.from_csv_array(arr) contest = new contest.title = arr[1] contest.date = parse_date(arr[0]) contest.organizer = arr.last.strip contest.code = parse_code(arr[0]) contest end |
Instance Method Details
#attributes ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/kisaweb/contest.rb', line 27 def attributes { :title => title, :organizer => organizer, :code => code, :date => date } end |