Class: ActionFlow::Expression::Group
- Inherits:
-
Object
- Object
- ActionFlow::Expression::Group
- Includes:
- Enumerable
- Defined in:
- lib/action_flow/expression.rb
Instance Method Summary collapse
- #+(expression) ⇒ Object
- #===(context) ⇒ Object
- #each(&block) ⇒ Object
-
#initialize ⇒ Group
constructor
A new instance of Group.
- #verb=(verb) ⇒ Object
Constructor Details
#initialize ⇒ Group
Returns a new instance of Group.
89 90 91 |
# File 'lib/action_flow/expression.rb', line 89 def initialize @exprs = [] end |
Instance Method Details
#+(expression) ⇒ Object
97 98 99 100 101 102 |
# File 'lib/action_flow/expression.rb', line 97 def +(expression) Enumerable === expression ? expression.each { |exp| @exprs << exp } : @exprs << expression self end |
#===(context) ⇒ Object
108 109 110 |
# File 'lib/action_flow/expression.rb', line 108 def ===(context) any? { |exp| exp === context } end |
#each(&block) ⇒ Object
93 94 95 |
# File 'lib/action_flow/expression.rb', line 93 def each(&block) @exprs.each(&block) end |
#verb=(verb) ⇒ Object
104 105 106 |
# File 'lib/action_flow/expression.rb', line 104 def verb=(verb) each { |exp| exp.verb = verb } end |