Class: OneSignal::Filter::FilterBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/onesignal/filter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(field, params = {}) ⇒ FilterBuilder

Returns a new instance of FilterBuilder.



84
85
86
87
88
89
# File 'lib/onesignal/filter.rb', line 84

def initialize field, params = {}
  @b_field = field
  @b_key = params[:key]
  @b_location = params[:location]
  @b_value = params[:value]
end

Instance Attribute Details

#b_fieldObject (readonly)

Returns the value of attribute b_field.



82
83
84
# File 'lib/onesignal/filter.rb', line 82

def b_field
  @b_field
end

#b_hours_agoObject (readonly)

Returns the value of attribute b_hours_ago.



82
83
84
# File 'lib/onesignal/filter.rb', line 82

def b_hours_ago
  @b_hours_ago
end

#b_keyObject (readonly)

Returns the value of attribute b_key.



82
83
84
# File 'lib/onesignal/filter.rb', line 82

def b_key
  @b_key
end

#b_locationObject (readonly)

Returns the value of attribute b_location.



82
83
84
# File 'lib/onesignal/filter.rb', line 82

def b_location
  @b_location
end

#b_relationObject (readonly)

Returns the value of attribute b_relation.



82
83
84
# File 'lib/onesignal/filter.rb', line 82

def b_relation
  @b_relation
end

#b_valueObject (readonly)

Returns the value of attribute b_value.



82
83
84
# File 'lib/onesignal/filter.rb', line 82

def b_value
  @b_value
end

Instance Method Details

#equals(value) ⇒ Object



103
104
105
106
107
# File 'lib/onesignal/filter.rb', line 103

def equals value
  @b_relation = '='
  @b_value = value.to_s
  build
end

#existsObject



115
116
117
118
# File 'lib/onesignal/filter.rb', line 115

def exists
  @b_relation = 'exists'
  build
end

#greater_than(value) ⇒ Object



97
98
99
100
101
# File 'lib/onesignal/filter.rb', line 97

def greater_than value
  @b_relation = '>'
  @b_value = value.to_s
  build
end

#lesser_than(value) ⇒ Object



91
92
93
94
95
# File 'lib/onesignal/filter.rb', line 91

def lesser_than value
  @b_relation = '<'
  @b_value = value.to_s
  build
end

#not_equals(value) ⇒ Object



109
110
111
112
113
# File 'lib/onesignal/filter.rb', line 109

def not_equals value
  @b_relation = '!='
  @b_value = value.to_s
  build
end

#not_existsObject



120
121
122
123
# File 'lib/onesignal/filter.rb', line 120

def not_exists
  @b_relation = 'not_exists'
  build
end