Class: Access::Filter
- Inherits:
-
Object
- Object
- Access::Filter
- Defined in:
- lib/access/filter.rb
Class Method Summary collapse
- .find(filter_key, options = {}) ⇒ Object
- .process_batch(chunk) ⇒ Object
- .search(options = {}) ⇒ Object
Instance Method Summary collapse
- #filter_key ⇒ Object
-
#initialize(values) ⇒ Filter
constructor
A new instance of Filter.
- #name ⇒ Object
Constructor Details
#initialize(values) ⇒ Filter
Returns a new instance of Filter.
18 19 20 21 22 23 |
# File 'lib/access/filter.rb', line 18 def initialize(values) self.class.class_eval { attr_reader *values.keys } values.each do |attribute_name, attribute_value| self.instance_variable_set("@#{attribute_name}", attribute_value) end end |
Class Method Details
.find(filter_key, options = {}) ⇒ Object
9 10 11 12 |
# File 'lib/access/filter.rb', line 9 def self.find(filter_key, = {}) # Internal Admin only Call Access::Api.new.find_filter filter_key, end |
.process_batch(chunk) ⇒ Object
14 15 16 |
# File 'lib/access/filter.rb', line 14 def self.process_batch(chunk) chunk.map { |filter| new(filter) } end |
.search(options = {}) ⇒ Object
4 5 6 7 |
# File 'lib/access/filter.rb', line 4 def self.search( = {}) # Internal Admin only Call Access::Api.new.search_filters end |
Instance Method Details
#filter_key ⇒ Object
25 26 27 |
# File 'lib/access/filter.rb', line 25 def filter_key @filter_id end |
#name ⇒ Object
29 30 31 |
# File 'lib/access/filter.rb', line 29 def name @filter_name end |