Class: Dionysus::Producer::Registry::Registration::Topic::ModelRegistration
- Inherits:
-
Object
- Object
- Dionysus::Producer::Registry::Registration::Topic::ModelRegistration
- Defined in:
- lib/dionysus/producer/registry.rb
Instance Attribute Summary collapse
-
#model_klass ⇒ Object
readonly
Returns the value of attribute model_klass.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #association_name_for_observable(resource, changeset) ⇒ Object
-
#initialize(model_klass, options = {}) ⇒ ModelRegistration
constructor
A new instance of ModelRegistration.
- #observables_config ⇒ Object
- #observes?(resource, changeset) ⇒ Boolean
Constructor Details
#initialize(model_klass, options = {}) ⇒ ModelRegistration
Returns a new instance of ModelRegistration.
89 90 91 92 93 |
# File 'lib/dionysus/producer/registry.rb', line 89 def initialize(model_klass, = {}) @model_klass = model_klass @options = validate_and_set_up end |
Instance Attribute Details
#model_klass ⇒ Object (readonly)
Returns the value of attribute model_klass.
87 88 89 |
# File 'lib/dionysus/producer/registry.rb', line 87 def model_klass @model_klass end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
87 88 89 |
# File 'lib/dionysus/producer/registry.rb', line 87 def @options end |
Instance Method Details
#association_name_for_observable(resource, changeset) ⇒ Object
99 100 101 |
# File 'lib/dionysus/producer/registry.rb', line 99 def association_name_for_observable(resource, changeset) observer_config_for(resource, changeset).fetch(:association_name) end |
#observables_config ⇒ Object
103 104 105 |
# File 'lib/dionysus/producer/registry.rb', line 103 def observables_config .fetch(:observe, []) end |
#observes?(resource, changeset) ⇒ Boolean
95 96 97 |
# File 'lib/dionysus/producer/registry.rb', line 95 def observes?(resource, changeset) observer_config_for(resource, changeset).present? end |