Class: PgExecArrayParams::Rewriters::Node
- Inherits:
-
Object
- Object
- PgExecArrayParams::Rewriters::Node
- Defined in:
- lib/pg_exec_array_params/rewriters/node.rb
Instance Attribute Summary collapse
-
#ref_idx ⇒ Object
readonly
Returns the value of attribute ref_idx.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(value, ref_idx) ⇒ Node
constructor
A new instance of Node.
- #process ⇒ Object
-
#to_s ⇒ Object
used in exception rendering.
Constructor Details
#initialize(value, ref_idx) ⇒ Node
Returns a new instance of Node.
8 9 10 11 |
# File 'lib/pg_exec_array_params/rewriters/node.rb', line 8 def initialize(value, ref_idx) @value = value @ref_idx = ref_idx end |
Instance Attribute Details
#ref_idx ⇒ Object (readonly)
Returns the value of attribute ref_idx.
6 7 8 |
# File 'lib/pg_exec_array_params/rewriters/node.rb', line 6 def ref_idx @ref_idx end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
6 7 8 |
# File 'lib/pg_exec_array_params/rewriters/node.rb', line 6 def value @value end |
Instance Method Details
#process ⇒ Object
13 14 15 |
# File 'lib/pg_exec_array_params/rewriters/node.rb', line 13 def process rewrite! if should_rewrite? end |
#to_s ⇒ Object
used in exception rendering
18 19 20 21 22 |
# File 'lib/pg_exec_array_params/rewriters/node.rb', line 18 def to_s return '<unknown node position>' unless (from, size = refs_at) "#{'^'.rjust(from, ' ')}#{'-'.rjust(size, '-')}^" end |