module DigitalOpera::Presenter::JsonSerialization

Public Instance Methods

as_json(opts={}) click to toggle source
Calls superclass method
# File lib/digital_opera/presenter/concerns/json_serialization.rb, line 8
def as_json(opts={})
  super(opts).merge( self.get_json_field_hash )
end
get_json_field_hash() click to toggle source
# File lib/digital_opera/presenter/concerns/json_serialization.rb, line 12
def get_json_field_hash
  json_field_hash = {}

  self.class.include_in_json.each do |method_name|
    json_field_hash[method_name.to_sym] = self.send(method_name)
  end

  json_field_hash
end