Class: Safrano::Filter::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/odata/filter/base.rb,
lib/odata/filter/tree.rb

Overview

Base class for Leaves, Trees, RootTrees etc

Direct Known Subclasses

Leave, RootTree

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(val, &block) ⇒ Node

Returns a new instance of Node.



12
13
14
15
# File 'lib/odata/filter/tree.rb', line 12

def initialize(val, &block)
  @value = val
  instance_eval(&block) if block_given?
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



10
11
12
# File 'lib/odata/filter/tree.rb', line 10

def value
  @value
end

Instance Method Details

#==(other) ⇒ Object



17
18
19
# File 'lib/odata/filter/tree.rb', line 17

def ==(other)
  @value == other.value
end

#success(res) ⇒ Object



7
8
9
# File 'lib/odata/filter/base.rb', line 7

def success(res)
  Contract.valid(res)
end