module Drillbit::Serializers::JsonApi::ClassMethods
Public Instance Methods
attribute(name, _options = {}, &block)
click to toggle source
# File lib/drillbit/serializers/json_api.rb, line 23 def attribute(name, _options = {}, &block) block ||= proc { @object.public_send(name) } attribute_blocks[name.to_s.tr('_', '-').to_sym] = block end
type_block()
click to toggle source
# File lib/drillbit/serializers/json_api.rb, line 7 def type_block proc { @object .class .name .gsub(/\A[^:]+::/, '') .split('::') .reverse .join('::') .tableize .dasherize .tr('/', '-') .pluralize } end