Class: Pacer::Filter::WhereFilter::NodeVisitor::Pipe
- Inherits:
-
Object
- Object
- Pacer::Filter::WhereFilter::NodeVisitor::Pipe
- Defined in:
- lib/pacer/filter/where_filter/node_visitor.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#pipe ⇒ Object
readonly
Returns the value of attribute pipe.
Instance Method Summary collapse
- #build ⇒ Object
- #build_args ⇒ Object
-
#initialize(pipe, *args) ⇒ Pipe
constructor
A new instance of Pipe.
- #inspect(depth = 0) ⇒ Object
Constructor Details
#initialize(pipe, *args) ⇒ Pipe
Returns a new instance of Pipe.
47 48 49 50 |
# File 'lib/pacer/filter/where_filter/node_visitor.rb', line 47 def initialize(pipe, *args) @pipe = pipe @args = args end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
53 54 55 |
# File 'lib/pacer/filter/where_filter/node_visitor.rb', line 53 def args @args end |
#pipe ⇒ Object (readonly)
Returns the value of attribute pipe.
52 53 54 |
# File 'lib/pacer/filter/where_filter/node_visitor.rb', line 52 def pipe @pipe end |
Instance Method Details
#build ⇒ Object
65 66 67 |
# File 'lib/pacer/filter/where_filter/node_visitor.rb', line 65 def build pipe.new *build_args end |
#build_args ⇒ Object
69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/pacer/filter/where_filter/node_visitor.rb', line 69 def build_args args.map do |arg| if arg.is_a? Pipe arg.build elsif arg.is_a? Value arg.value else arg end end end |
#inspect(depth = 0) ⇒ Object
55 56 57 58 59 60 61 62 63 |
# File 'lib/pacer/filter/where_filter/node_visitor.rb', line 55 def inspect(depth = 0) ([" " * depth + pipe.to_s] + args.map do |arg| if arg.is_a? Pipe or arg.is_a? Value arg.inspect(depth + 2) else " " * (depth + 2) + arg.to_s end end).join "\n" end |