Module: Evalso::Languages

Defined in:
lib/evalso/languages.rb

Class Method Summary collapse

Class Method Details

.languagesObject



6
7
8
9
# File 'lib/evalso/languages.rb', line 6

def languages
  raw = HTTParty.get(Evalso.base_uri + 'languages').body
  parse(JSON.parse(raw))
end

.parse(hash) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/evalso/languages.rb', line 11

def parse(hash)
  hash.keys.each do |k|
    hash[k] = Language.new(k, hash[k])
  end

  hash
end