Class: Integrative::Integration
- Inherits:
-
Object
- Object
- Integrative::Integration
- Defined in:
- lib/integrative/integration.rb
Instance Attribute Summary collapse
-
#call_options ⇒ Object
Returns the value of attribute call_options.
-
#init_options ⇒ Object
Returns the value of attribute init_options.
-
#integrated_class ⇒ Object
Returns the value of attribute integrated_class.
-
#integrator_class ⇒ Object
Returns the value of attribute integrator_class.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, integrator_class, options) ⇒ Integration
constructor
A new instance of Integration.
- #integrated_key ⇒ Object
- #integrator_key ⇒ Object
- #invalidate ⇒ Object
- #setter ⇒ Object
Constructor Details
#initialize(name, integrator_class, options) ⇒ Integration
Returns a new instance of Integration.
9 10 11 12 13 14 |
# File 'lib/integrative/integration.rb', line 9 def initialize(name, integrator_class, ) @name = name @integrator_class = integrator_class @integrated_class = name.to_s.camelize.singularize.constantize = end |
Instance Attribute Details
#call_options ⇒ Object
Returns the value of attribute call_options.
7 8 9 |
# File 'lib/integrative/integration.rb', line 7 def end |
#init_options ⇒ Object
Returns the value of attribute init_options.
6 7 8 |
# File 'lib/integrative/integration.rb', line 6 def end |
#integrated_class ⇒ Object
Returns the value of attribute integrated_class.
5 6 7 |
# File 'lib/integrative/integration.rb', line 5 def integrated_class @integrated_class end |
#integrator_class ⇒ Object
Returns the value of attribute integrator_class.
4 5 6 |
# File 'lib/integrative/integration.rb', line 4 def integrator_class @integrator_class end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/integrative/integration.rb', line 3 def name @name end |
Instance Method Details
#integrated_key ⇒ Object
47 48 49 50 |
# File 'lib/integrative/integration.rb', line 47 def integrated_key default_integrated_key = "#{integrator_class.name.underscore}_id" [:integrated_key] || default_integrated_key end |
#integrator_key ⇒ Object
43 44 45 |
# File 'lib/integrative/integration.rb', line 43 def integrator_key [:integrator_key] || :id end |
#invalidate ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/integrative/integration.rb', line 16 def invalidate if .blank? && [:requires].present? raise Errors::RuntimeOptionMissingError.new(self) end if .present? && [:requires].blank? raise Errors::UnexpectedRuntimeOptionError.new(self) end if .present? && [:requires].present? = .keys - [:requires] = [:requires] - .keys if .present? raise Errors::TooManyRuntimeOptionsError.new(self, ) end if .present? raise Errors::TooLittleRuntimeOptionsError.new(self, ) end end end |
#setter ⇒ Object
39 40 41 |
# File 'lib/integrative/integration.rb', line 39 def setter "#{name}=" end |