Module: JSONAPI::EmberSerializer::InstanceMethods

Defined in:
lib/jsonapi/ember_serializer.rb

Instance Method Summary collapse

Instance Method Details

#format_name(attribute_name) ⇒ Object


22
23
24
# File 'lib/jsonapi/ember_serializer.rb', line 22

def format_name(attribute_name)
  attribute_name.to_s.underscore.camelize(:lower)
end

34
35
36
# File 'lib/jsonapi/ember_serializer.rb', line 34

def relationship_related_link(attribute_name)
  "#{self_link}/#{format_name_for_link(attribute_name)}"
end

30
31
32
# File 'lib/jsonapi/ember_serializer.rb', line 30

def relationship_self_link(attribute_name)
  "#{self_link}/relationships/#{format_name_for_link(attribute_name)}"
end

26
27
28
# File 'lib/jsonapi/ember_serializer.rb', line 26

def self_link
  "#{base_url}/#{type_for_link}/#{id}"
end

#typeObject


18
19
20
# File 'lib/jsonapi/ember_serializer.rb', line 18

def type
  object.class.name.demodulize.underscore.dasherize
end