Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/formula_eval.rb,
lib/formula_eval.rb,
lib/formula_eval.rb,
lib/formula_eval.rb,
lib/formula_eval/wrapper.rb,
lib/formula_eval/multi_eval.rb
Instance Attribute Summary collapse
-
#calculating_formula ⇒ Object
Returns the value of attribute calculating_formula.
Instance Method Summary collapse
- #blank? ⇒ Boolean
- #klass ⇒ Object
- #my_instance_eval(*args, &b) ⇒ Object
- #present? ⇒ Boolean
- #smart_respond_to?(k, args) ⇒ Boolean
- #to_unwrapped ⇒ Object
- #to_unwrapped_inner ⇒ Object
- #to_wrapped ⇒ Object
Instance Attribute Details
#calculating_formula ⇒ Object
Returns the value of attribute calculating_formula.
5 6 7 |
# File 'lib/formula_eval.rb', line 5 def calculating_formula @calculating_formula end |
Instance Method Details
#blank? ⇒ Boolean
112 113 114 |
# File 'lib/formula_eval.rb', line 112 def blank? to_s.strip == '' end |
#klass ⇒ Object
106 107 108 |
# File 'lib/formula_eval.rb', line 106 def klass self.class end |
#my_instance_eval(*args, &b) ⇒ Object
121 122 123 |
# File 'lib/formula_eval.rb', line 121 def my_instance_eval(*args,&b) instance_eval(*args,&b) end |
#present? ⇒ Boolean
115 116 117 |
# File 'lib/formula_eval.rb', line 115 def present? !blank? end |
#smart_respond_to?(k, args) ⇒ Boolean
67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/formula_eval/multi_eval.rb', line 67 def smart_respond_to?(k,args) sup = respond_to?(k) if k.to_s == '[]' return false if args.first.kind_of?(Numeric) && kind_of?(Hash) return false if !args.first.kind_of?(Numeric) && kind_of?(Array) return false if !args.first.kind_of?(Numeric) && kind_of?(Numeric) return false if !args.first.kind_of?(Numeric) && kind_of?(String) sup else sup end end |
#to_unwrapped ⇒ Object
160 161 162 |
# File 'lib/formula_eval/wrapper.rb', line 160 def to_unwrapped to_unwrapped_inner.tap { |x| mylog 'unwrap', :klass => self.klass, :unwrapped => x.class } end |