Class: Counter::Cache::OptionsParser
- Inherits:
-
Struct
- Object
- Struct
- Counter::Cache::OptionsParser
- Defined in:
- lib/counter/cache/options_parser.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #cached? ⇒ Boolean
- #column ⇒ Object
- #if_value ⇒ Object
- #increment_by ⇒ Object
- #method ⇒ Object
- #polymorphic? ⇒ Boolean
- #recalculation? ⇒ Boolean
- #recalculation_delay ⇒ Object
- #relation ⇒ Object
- #relation_class_name ⇒ Object
- #relation_id ⇒ Object
- #source_object_class_name ⇒ Object
- #touch_column ⇒ Object
- #wait(source_object) ⇒ Object
- #worker_adapter ⇒ Object
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options
3 4 5 |
# File 'lib/counter/cache/options_parser.rb', line 3 def @options end |
Instance Method Details
#cached? ⇒ Boolean
40 41 42 |
# File 'lib/counter/cache/options_parser.rb', line 40 def cached? option_or_true [:cache] end |
#column ⇒ Object
12 13 14 |
# File 'lib/counter/cache/options_parser.rb', line 12 def column [:column] end |
#if_value ⇒ Object
52 53 54 |
# File 'lib/counter/cache/options_parser.rb', line 52 def if_value [:if] end |
#increment_by ⇒ Object
36 37 38 |
# File 'lib/counter/cache/options_parser.rb', line 36 def increment_by [:increment_by] end |
#method ⇒ Object
32 33 34 |
# File 'lib/counter/cache/options_parser.rb', line 32 def method [:method] end |
#polymorphic? ⇒ Boolean
48 49 50 |
# File 'lib/counter/cache/options_parser.rb', line 48 def polymorphic? [:polymorphic] end |
#recalculation? ⇒ Boolean
44 45 46 |
# File 'lib/counter/cache/options_parser.rb', line 44 def recalculation? option_or_true [:recalculation] end |
#recalculation_delay ⇒ Object
65 66 67 |
# File 'lib/counter/cache/options_parser.rb', line 65 def recalculation_delay [:recalculation_delay] || Counter::Cache.configuration.recalculation_delay end |
#relation ⇒ Object
20 21 22 |
# File 'lib/counter/cache/options_parser.rb', line 20 def relation [:relation] end |
#relation_class_name ⇒ Object
24 25 26 |
# File 'lib/counter/cache/options_parser.rb', line 24 def relation_class_name [:relation_class_name] end |
#relation_id ⇒ Object
28 29 30 |
# File 'lib/counter/cache/options_parser.rb', line 28 def relation_id [:relation_id] end |
#source_object_class_name ⇒ Object
8 9 10 |
# File 'lib/counter/cache/options_parser.rb', line 8 def source_object_class_name [:source_object_class_name] end |
#touch_column ⇒ Object
16 17 18 |
# File 'lib/counter/cache/options_parser.rb', line 16 def touch_column [:touch_column] end |
#wait(source_object) ⇒ Object
56 57 58 59 60 61 62 63 |
# File 'lib/counter/cache/options_parser.rb', line 56 def wait(source_object) wait = [:wait] if wait.respond_to?(:call) wait.call(source_object) else wait end end |
#worker_adapter ⇒ Object
4 5 6 |
# File 'lib/counter/cache/options_parser.rb', line 4 def worker_adapter [:worker_adapter] || Counter::Cache.configuration.default_worker_adapter end |