Class: Array
Instance Method Summary collapse
- #_select_js(callable) ⇒ Object
- #indexOf(item) ⇒ Object
-
#to_ruby(depth = 0) ⇒ Object
New array with all components converted to_ruby.
Instance Method Details
#_select_js(callable) ⇒ Object
6 7 8 9 10 |
# File 'lib/h8/context.rb', line 6 def _select_js callable select { |item| callable.call item } end |
#indexOf(item) ⇒ Object
12 13 14 |
# File 'lib/h8/context.rb', line 12 def indexOf item index(item) || -1 end |
#to_ruby(depth = 0) ⇒ Object
Returns new array with all components converted to_ruby.
209 210 211 212 |
# File 'lib/h8/value.rb', line 209 def to_ruby depth=0 depth += 1 map { |x| x.to_ruby depth } end |