Module: SerializeWith::InstanceMethods
- Defined in:
- lib/serialize_with.rb
Instance Method Summary collapse
- #as_json(context = nil, options = {}) ⇒ Object
- #serializable_hash(local_options = nil) ⇒ Object
- #to_xml(context = nil, options = {}) ⇒ Object
Instance Method Details
#as_json(context = nil, options = {}) ⇒ Object
23 24 25 |
# File 'lib/serialize_with.rb', line 23 def as_json(context = nil, = {}) super((context, )) end |
#serializable_hash(local_options = nil) ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/serialize_with.rb', line 31 def serializable_hash( = nil) ||= {} context = [:context] || :default = self.class. = (context, , ) HashWithIndifferentAccess.new(super()) end |
#to_xml(context = nil, options = {}) ⇒ Object
27 28 29 |
# File 'lib/serialize_with.rb', line 27 def to_xml(context = nil, = {}) super((context, )) end |