Class: GfreshPoint::RequestObjects::RuleListRequest

Inherits:
RequestObject
  • Object
show all
Defined in:
lib/gfresh_point/request_objects/rule_list_request.rb

Constant Summary collapse

ACCEPTED_FILTERS =
['app_id']

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from RequestObject

#add_error, #errors, #has_errors, #success?

Constructor Details

#initialize(params = {}) ⇒ RuleListRequest

Returns a new instance of RuleListRequest.



8
9
10
11
12
13
14
15
# File 'lib/gfresh_point/request_objects/rule_list_request.rb', line 8

def initialize(params = {})
  @filters = params[:filters] || {}
  @filters.keys.each do |filter|
    unless ACCEPTED_FILTERS.include?(filter.to_s)
      add_error('filters', "Key #{filter} can not be used")
    end
  end
end

Instance Attribute Details

#filtersObject

Returns the value of attribute filters.



4
5
6
# File 'lib/gfresh_point/request_objects/rule_list_request.rb', line 4

def filters
  @filters
end