Class: Array

Inherits:
Object show all
Defined in:
lib/formula_eval/wrapper.rb,
lib/formula_eval/wrapper.rb,
lib/formula_eval/wrapper.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(sym, *args, &b) ⇒ Object



64
65
66
67
68
69
70
# File 'lib/formula_eval/wrapper.rb', line 64

def method_missing(sym,*args,&b)
  if sym.to_s =~ /_arrayindex_(\d+)/
    self[$1.to_i].to_wrapped
  else
    super
  end 
end

Instance Method Details

#contains_all_hashes?Boolean

Returns:

  • (Boolean)


58
59
60
# File 'lib/formula_eval/wrapper.rb', line 58

def contains_all_hashes?
  all? { |x| x.kind_of?(Hash) || x.kind_of?(OrderedHash) }
end

#to_unwrappedObject



120
121
122
# File 'lib/formula_eval/wrapper.rb', line 120

def to_unwrapped
  map { |x| x.to_unwrapped } 
end