Class: Braintree::AdvancedSearch::SearchNode

Inherits:
Object
  • Object
show all
Defined in:
lib/braintree/advanced_search.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, parent) ⇒ SearchNode

Returns a new instance of SearchNode.



12
13
14
# File 'lib/braintree/advanced_search.rb', line 12

def initialize(name, parent)
  @node_name, @parent = name, parent
end

Class Method Details

.operators(*operator_names) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/braintree/advanced_search.rb', line 4

def self.operators(*operator_names)
  operator_names.each do |operator|
    define_method(operator) do |value|
      @parent.add_criteria(@node_name, operator => value.to_s)
    end
  end
end