Class: Ruby::Rego::AST::ArrayComprehension
- Defined in:
- lib/ruby/rego/ast/comprehension.rb
Overview
Represents an array comprehension.
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
-
#term ⇒ Object
readonly
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(term:, body:, location: nil) ⇒ ArrayComprehension
constructor
A new instance of ArrayComprehension.
Methods inherited from Base
#==, #accept, #deconstruct_keys, #eql?, format_value, #hash, #to_s
Constructor Details
#initialize(term:, body:, location: nil) ⇒ ArrayComprehension
Returns a new instance of ArrayComprehension.
13 14 15 16 17 |
# File 'lib/ruby/rego/ast/comprehension.rb', line 13 def initialize(term:, body:, location: nil) super(location: location) @term = term @body = body.dup.freeze end |
Instance Attribute Details
#body ⇒ Object (readonly)
23 24 25 |
# File 'lib/ruby/rego/ast/comprehension.rb', line 23 def body @body end |
#term ⇒ Object (readonly)
20 21 22 |
# File 'lib/ruby/rego/ast/comprehension.rb', line 20 def term @term end |