Module: Artery::Model
- Defined in:
- lib/artery/model.rb,
lib/artery/model/callbacks.rb,
lib/artery/model/subscriptions.rb
Defined Under Namespace
Modules: Callbacks, ClassMethods, InstanceMethods, Subscriptions
Instance Method Summary collapse
Instance Method Details
#artery_model(options = {}) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/artery/model.rb', line 8 def artery_model( = {}) extend ClassMethods include InstanceMethods [:name] ||= to_s.demodulize.underscore.to_sym [:source] = false if [:source].nil? [:uuid_attribute] = :uuid if [:uuid_attribute].nil? class_attribute :artery, instance_writer: false self.artery = .merge(representations: { _default: proc { attributes } }) include Subscriptions include Callbacks if artery_source_model? artery_scope :all, -> { all } end |