Module: Unparser::Anima::InstanceMethods
- Defined in:
- lib/unparser/anima.rb
Overview
Static instance methods for anima infected classes
Instance Method Summary collapse
-
#initialize(attributes) ⇒ undefined
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
Initialize an anima infected object
rubocop:disable Lint/MissingSuper
91 92 93 |
# File 'lib/unparser/anima.rb', line 91 def initialize(attributes) self.class.anima.initialize_instance(self, attributes) end |
#to_h ⇒ Hash
Return a hash representation of an anima infected object
104 105 106 |
# File 'lib/unparser/anima.rb', line 104 def to_h self.class.anima.attributes_hash(self) end |
#with(attributes) ⇒ Anima
Return updated instance
125 126 127 |
# File 'lib/unparser/anima.rb', line 125 def with(attributes) self.class.new(to_h.update(attributes)) end |