Class: Csquery::Structured::Builder

Inherits:
ExpressionBuilder show all
Defined in:
lib/csquery/structured/builder.rb

Instance Attribute Summary collapse

Attributes inherited from ExpressionBuilder

#expressions

Instance Method Summary collapse

Methods inherited from ExpressionBuilder

#method_missing, #or_concat_

Constructor Details

#initialize(root, &block) ⇒ Builder

Returns a new instance of Builder.



6
7
8
9
# File 'lib/csquery/structured/builder.rb', line 6

def initialize(root, &block)
  @root = root
  super(&block)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Csquery::Structured::ExpressionBuilder

Instance Attribute Details

#rootObject (readonly)

Returns the value of attribute root.



4
5
6
# File 'lib/csquery/structured/builder.rb', line 4

def root
  @root
end

Instance Method Details

#queryObject



11
12
13
# File 'lib/csquery/structured/builder.rb', line 11

def query
  Structured.public_send(root, *expressions).query
end