Class: RademadeAdmin::Search::Conditions::Where

Inherits:
Object
  • Object
show all
Defined in:
app/services/search/conditions/part/where.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type) ⇒ Where

Returns a new instance of Where.



9
10
11
12
# File 'app/services/search/conditions/part/where.rb', line 9

def initialize(type)
  @type = type
  @parts = []
end

Instance Attribute Details

#partsObject (readonly)

Returns the value of attribute parts.



7
8
9
# File 'app/services/search/conditions/part/where.rb', line 7

def parts
  @parts
end

#typeObject (readonly)

Returns the value of attribute type.



7
8
9
# File 'app/services/search/conditions/part/where.rb', line 7

def type
  @type
end

Instance Method Details

#add(field, value) ⇒ Object



14
15
16
17
18
19
# File 'app/services/search/conditions/part/where.rb', line 14

def add(field, value)
  @parts << {
    :field => field,
    :value => value
  }
end

#sub_add(where) ⇒ Object



21
22
23
# File 'app/services/search/conditions/part/where.rb', line 21

def sub_add(where)
  @parts << where
end