Class: Wandbox::List
- Inherits:
-
Object
- Object
- Wandbox::List
- Includes:
- Enumerable, Iolite::Placeholders
- Defined in:
- lib/wandbox/list.rb
Instance Method Summary collapse
- #each(&block) ⇒ Object
- #empty? ⇒ Boolean
- #find_compiler(compiler) ⇒ Object
-
#initialize(list) ⇒ List
constructor
A new instance of List.
- #languages ⇒ Object
- #select_by_language(lang) ⇒ Object
- #to_ary ⇒ Object
Constructor Details
#initialize(list) ⇒ List
Returns a new instance of List.
10 11 12 |
# File 'lib/wandbox/list.rb', line 10 def initialize list @list = list end |
Instance Method Details
#each(&block) ⇒ Object
14 15 16 |
# File 'lib/wandbox/list.rb', line 14 def each &block @list.each &block end |
#empty? ⇒ Boolean
31 32 33 |
# File 'lib/wandbox/list.rb', line 31 def empty? @list.empty? end |
#find_compiler(compiler) ⇒ Object
27 28 29 |
# File 'lib/wandbox/list.rb', line 27 def find_compiler compiler find &arg1["name"] == compiler end |
#languages ⇒ Object
18 19 20 |
# File 'lib/wandbox/list.rb', line 18 def languages map(&arg1["language"]).uniq end |
#select_by_language(lang) ⇒ Object
22 23 24 25 |
# File 'lib/wandbox/list.rb', line 22 def select_by_language lang lang = lang.downcase select &arg1["language"].downcase == lang end |
#to_ary ⇒ Object
35 36 37 |
# File 'lib/wandbox/list.rb', line 35 def to_ary @list end |