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 Also known as: ==



107
108
109
110
111
# File 'lib/onesignal/filter.rb', line 107

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

#existsObject



123
124
125
126
# File 'lib/onesignal/filter.rb', line 123

def exists
  @b_relation = 'exists'
  build
end

#greater_than(value) ⇒ Object Also known as: >



99
100
101
102
103
# File 'lib/onesignal/filter.rb', line 99

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

#lesser_than(value) ⇒ Object Also known as: <



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 Also known as: !=



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

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

#not_existsObject



128
129
130
131
# File 'lib/onesignal/filter.rb', line 128

def not_exists
  @b_relation = 'not_exists'
  build
end