Class: Featurevisor::Modules::FeaturevisorModule
- Inherits:
-
Object
- Object
- Featurevisor::Modules::FeaturevisorModule
- Defined in:
- lib/featurevisor/modules.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #call_after(evaluation, options) ⇒ Object
- #call_before(options) ⇒ Object
- #call_bucket_key(options) ⇒ Object
- #call_bucket_value(options) ⇒ Object
- #call_close ⇒ Object
- #call_setup(api) ⇒ Object
-
#initialize(options = {}) ⇒ FeaturevisorModule
constructor
A new instance of FeaturevisorModule.
Constructor Details
#initialize(options = {}) ⇒ FeaturevisorModule
Returns a new instance of FeaturevisorModule.
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/featurevisor/modules.rb', line 11 def initialize( = {}) @id = SecureRandom.uuid @name = [:name] @setup = [:setup] @before = [:before] @bucket_key = [:bucket_key] @bucket_value = [:bucket_value] @after = [:after] @close = [:close] end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
9 10 11 |
# File 'lib/featurevisor/modules.rb', line 9 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
9 10 11 |
# File 'lib/featurevisor/modules.rb', line 9 def name @name end |
Instance Method Details
#call_after(evaluation, options) ⇒ Object
44 45 46 47 48 |
# File 'lib/featurevisor/modules.rb', line 44 def call_after(evaluation, ) return evaluation unless @after @after.call(evaluation, ) end |
#call_before(options) ⇒ Object
26 27 28 29 30 |
# File 'lib/featurevisor/modules.rb', line 26 def call_before() return unless @before @before.call() end |
#call_bucket_key(options) ⇒ Object
32 33 34 35 36 |
# File 'lib/featurevisor/modules.rb', line 32 def call_bucket_key() return [:bucket_key] unless @bucket_key @bucket_key.call() end |
#call_bucket_value(options) ⇒ Object
38 39 40 41 42 |
# File 'lib/featurevisor/modules.rb', line 38 def call_bucket_value() return [:bucket_value] unless @bucket_value @bucket_value.call() end |
#call_close ⇒ Object
50 51 52 |
# File 'lib/featurevisor/modules.rb', line 50 def call_close @close.call if @close end |
#call_setup(api) ⇒ Object
22 23 24 |
# File 'lib/featurevisor/modules.rb', line 22 def call_setup(api) @setup.call(api) if @setup end |