class BELParser::Parsers::AST::Domain

AST node representing a domain (e.g. Url, Uri, List, Pattern).

Public Class Methods

new(children = [], properties = {}) click to toggle source

New Domain AST node.

@see Node#initialize Node class for basic properties

Calls superclass method BELParser::Parsers::AST::Node::new
# File lib/bel_parser/parsers/ast/node.rb, line 358
def initialize(children = [], properties = {})
  super(Domain.ast_type, children, properties)
end

Public Instance Methods

child() click to toggle source

Get the domain's Url.

# File lib/bel_parser/parsers/ast/node.rb, line 383
def child
  children[0]
end
list?() click to toggle source

Determine if this is a LIST domain.

# File lib/bel_parser/parsers/ast/node.rb, line 363
def list?
  children[0] && children[0].is_a?(List)
end
pattern?() click to toggle source

Determine if this is a PATTERN domain.

# File lib/bel_parser/parsers/ast/node.rb, line 368
def pattern?
  children[0] && children[0].is_a?(Pattern)
end
uri?() click to toggle source

Determine if this is a URI domain.

# File lib/bel_parser/parsers/ast/node.rb, line 373
def uri?
  children[0] && children[0].is_a?(Uri)
end
url?() click to toggle source

Determine if this is a URL domain.

# File lib/bel_parser/parsers/ast/node.rb, line 378
def url?
  children[0] && children[0].is_a?(Url)
end