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_after_evaluation(evaluation, options) ⇒ Object
- #call_before(options) ⇒ Object
- #call_before_evaluation(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 21 22 |
# File 'lib/featurevisor/modules.rb', line 11 def initialize( = {}) @id = SecureRandom.uuid @name = [:name] @setup = [:setup] @before = [:before] @before_evaluation = [:before_evaluation] || [:beforeEvaluation] @bucket_key = [:bucket_key] @bucket_value = [:bucket_value] @after = [:after] @after_evaluation = [:after_evaluation] || [:afterEvaluation] @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
52 53 54 55 56 |
# File 'lib/featurevisor/modules.rb', line 52 def call_after(evaluation, ) return evaluation unless @after @after.call(evaluation, ) end |
#call_after_evaluation(evaluation, options) ⇒ Object
58 59 60 61 62 |
# File 'lib/featurevisor/modules.rb', line 58 def call_after_evaluation(evaluation, ) return evaluation unless @after_evaluation @after_evaluation.call(evaluation, ) end |
#call_before(options) ⇒ Object
28 29 30 31 32 |
# File 'lib/featurevisor/modules.rb', line 28 def call_before() return unless @before @before.call() end |
#call_before_evaluation(options) ⇒ Object
34 35 36 37 38 |
# File 'lib/featurevisor/modules.rb', line 34 def call_before_evaluation() return unless @before_evaluation @before_evaluation.call() end |
#call_bucket_key(options) ⇒ Object
40 41 42 43 44 |
# File 'lib/featurevisor/modules.rb', line 40 def call_bucket_key() return [:bucket_key] unless @bucket_key @bucket_key.call() end |
#call_bucket_value(options) ⇒ Object
46 47 48 49 50 |
# File 'lib/featurevisor/modules.rb', line 46 def call_bucket_value() return [:bucket_value] unless @bucket_value @bucket_value.call() end |
#call_close ⇒ Object
64 65 66 |
# File 'lib/featurevisor/modules.rb', line 64 def call_close @close.call if @close end |
#call_setup(api) ⇒ Object
24 25 26 |
# File 'lib/featurevisor/modules.rb', line 24 def call_setup(api) @setup.call(api) if @setup end |