Class: BELParser::Parsers::AST::Domain
- Defined in:
- lib/bel_parser/parsers/ast/node.rb
Overview
AST node representing a domain (e.g. Url, Uri, List, Pattern).
Instance Attribute Summary
Attributes inherited from Node
#character_range, #complete, #line_number
Attributes inherited from AST::Node
Instance Method Summary collapse
-
#child ⇒ Object
Get the domain’s Url.
-
#initialize(children = [], properties = {}) ⇒ Domain
constructor
New Domain AST node.
-
#list? ⇒ Boolean
Determine if this is a LIST domain.
-
#pattern? ⇒ Boolean
Determine if this is a PATTERN domain.
-
#uri? ⇒ Boolean
Determine if this is a URI domain.
-
#url? ⇒ Boolean
Determine if this is a URL domain.
Methods inherited from Node
#add_syntax_error, #append, #children?, #complete?, #concat, #first_child, #fourth_child, #freeze, #incomplete?, #num_children, #range_end, #range_start, #second_child, #syntax_errors, #third_child, #traverse, #updated
Methods inherited from AST::Node
#==, #append, #concat, #dup, #eql?, #inspect, #to_a, #to_ast, #to_sexp, #updated
Constructor Details
Instance Method Details
#child ⇒ Object
Get the domain’s Url.
383 384 385 |
# File 'lib/bel_parser/parsers/ast/node.rb', line 383 def child children[0] end |
#list? ⇒ Boolean
Determine if this is a LIST domain.
363 364 365 |
# File 'lib/bel_parser/parsers/ast/node.rb', line 363 def list? children[0] && children[0].is_a?(List) end |
#pattern? ⇒ Boolean
Determine if this is a PATTERN domain.
368 369 370 |
# File 'lib/bel_parser/parsers/ast/node.rb', line 368 def pattern? children[0] && children[0].is_a?(Pattern) end |
#uri? ⇒ Boolean
Determine if this is a URI domain.
373 374 375 |
# File 'lib/bel_parser/parsers/ast/node.rb', line 373 def uri? children[0] && children[0].is_a?(Uri) end |
#url? ⇒ Boolean
Determine if this is a URL domain.
378 379 380 |
# File 'lib/bel_parser/parsers/ast/node.rb', line 378 def url? children[0] && children[0].is_a?(Url) end |