Module: Anima::InstanceMethods Private
- Defined in:
- lib/anima.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Static instance methods for anima infected classes
Instance Method Summary collapse
-
#initialize(attributes) ⇒ undefined
private
Initialize an anima infected object.
-
#to_h ⇒ Hash
Return a hash representation of an anima infected object.
-
#with(attributes) ⇒ Anima
Return updated instance.
Instance Method Details
#initialize(attributes) ⇒ undefined
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initialize an anima infected object
88 89 90 |
# File 'lib/anima.rb', line 88 def initialize(attributes) self.class.anima.initialize_instance(self, attributes) end |
#to_h ⇒ Hash
Return a hash representation of an anima infected object
100 101 102 |
# File 'lib/anima.rb', line 100 def to_h self.class.anima.attributes_hash(self) end |
#with(attributes) ⇒ Anima
Return updated instance
121 122 123 |
# File 'lib/anima.rb', line 121 def with(attributes) self.class.new(to_h.update(attributes)) end |