Class: DRG::Ruby::Func
- Inherits:
-
Struct
- Object
- Struct
- DRG::Ruby::Func
- Defined in:
- lib/drg/ruby/func.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#_private ⇒ Object
(also: #private?)
Returns the value of attribute _private.
-
#sexp ⇒ Object
Returns the value of attribute sexp.
Instance Method Summary collapse
Instance Attribute Details
#_private ⇒ Object Also known as: private?
Returns the value of attribute _private
1 2 3 |
# File 'lib/drg/ruby/func.rb', line 1 def _private @_private end |
#sexp ⇒ Object
Returns the value of attribute sexp
1 2 3 |
# File 'lib/drg/ruby/func.rb', line 1 def sexp @sexp end |
Instance Method Details
#conditions ⇒ Object
4 5 6 7 8 |
# File 'lib/drg/ruby/func.rb', line 4 def conditions DRG::Decorators::SexpDecorator.new(sexp).each_sexp_condition.map do |exp| DRG::Ruby::Condition.new(exp) end end |
#map_args(_sexp = sexp, list = []) ⇒ Object
Note:
we drop(1) to get rid of :args (which should be the first item in the sexp)
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/drg/ruby/func.rb', line 11 def map_args(_sexp = sexp, list = []) val = _sexp.first return list.drop(1) unless val case val when Symbol map_args(_sexp.drop(1), list << val) when Sexp map_args(_sexp.drop(1), list << val[1]) else nil end end |