module Attributary::Serializer::InstanceMethods
Public Instance Methods
as_json()
click to toggle source
# File lib/attributary/serializer.rb, line 12 def as_json hash = {} self.class._attributary_attribute_set.keys.each do |key| hash[key] = read_attribute_for_serialization(key) end hash end
read_attribute_for_serialization(attribute_name)
click to toggle source
# File lib/attributary/serializer.rb, line 8 def read_attribute_for_serialization(attribute_name) send(attribute_name) end