Class: AOJ::Language

Inherits:
Object
  • Object
show all
Defined in:
lib/aoj/language.rb

Class Attribute Summary collapse

Instance Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.extnamesObject (readonly)

Returns the value of attribute extnames.



46
47
48
# File 'lib/aoj/language.rb', line 46

def extnames
  @extnames
end

.languagesObject (readonly)

Returns the value of attribute languages.



46
47
48
# File 'lib/aoj/language.rb', line 46

def languages
  @languages
end

Instance Attribute Details

#keyObject

Returns the value of attribute key.



3
4
5
# File 'lib/aoj/language.rb', line 3

def key
  @key
end

#submit_nameObject

Returns the value of attribute submit_name.



3
4
5
# File 'lib/aoj/language.rb', line 3

def submit_name
  @submit_name
end

Class Method Details

.find(key) ⇒ Object



48
49
50
# File 'lib/aoj/language.rb', line 48

def find(key)
  languages.find { |l| l.key == key }
end

.find_by_ext(ext) ⇒ Object



52
53
54
# File 'lib/aoj/language.rb', line 52

def find_by_ext(ext)
  languages.find { |l| l.key == extnames[ext] }
end