Class: RSpock::AST::Parser::WhereBlock
- Inherits:
-
Block
- Object
- Block
- RSpock::AST::Parser::WhereBlock
show all
- Defined in:
- lib/rspock/ast/parser/where_block.rb
Defined Under Namespace
Classes: MalformedError
Instance Attribute Summary
Attributes inherited from Block
#node, #type
Instance Method Summary
collapse
Methods inherited from Block
#<<, #can_start?, #children, #range, #succession_error_msg, #successors, #valid_successor?
Constructor Details
Returns a new instance of WhereBlock.
10
11
12
|
# File 'lib/rspock/ast/parser/where_block.rb', line 10
def initialize(node)
super(:Where, node)
end
|
Instance Method Details
#can_end? ⇒ Boolean
28
29
30
|
# File 'lib/rspock/ast/parser/where_block.rb', line 28
def can_end?
true
end
|
#data ⇒ Object
18
19
20
|
# File 'lib/rspock/ast/parser/where_block.rb', line 18
def data
@data ||= parse_data
end
|
14
15
16
|
# File 'lib/rspock/ast/parser/where_block.rb', line 14
def
@header ||=
end
|
#to_rspock_node ⇒ Object
22
23
24
25
26
|
# File 'lib/rspock/ast/parser/where_block.rb', line 22
def to_rspock_node
= s(:rspock_where_header, *.map { |col| s(:sym, col) })
data_nodes = data.map { |row| s(:array, *row) }
s(:rspock_where, , *data_nodes)
end
|