Class: Kisaweb::OnlineRanki

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

Class Method Summary collapse

Class Method Details

.categoriesObject



16
17
18
19
# File 'lib/kisaweb/online_ranki.rb', line 16

def self.categories
  @@categories ||= parse_categories(Iconv.iconv('utf-8', 'latin1',
                                          fetch_categories.body).first.strip)
end

.dateObject



12
13
14
# File 'lib/kisaweb/online_ranki.rb', line 12

def self.date
  @@date ||= Date.parse(Iconv.iconv('utf-8', 'latin1', fetch_date.body).first.strip)
end

.find(klass) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/kisaweb/online_ranki.rb', line 3

def self.find(klass)
  res = fetch_class(:klass => klass)
  res_arr = FasterCSV.parse(Iconv.iconv('utf-8', 'latin1', res.body).first.strip)
  res_arr.shift
  res_arr.map do |row|
    ListItem.from_array(row)
  end
end