Module: JSONAPI::EmberSerializer::InstanceMethods
- Defined in:
- lib/jsonapi/ember_serializer.rb
Instance Method Summary collapse
- #format_name(attribute_name) ⇒ Object
- #relationship_related_link(attribute_name) ⇒ Object
- #relationship_self_link(attribute_name) ⇒ Object
- #self_link ⇒ Object
- #type ⇒ Object
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 |
#relationship_related_link(attribute_name) ⇒ Object
34 35 36 |
# File 'lib/jsonapi/ember_serializer.rb', line 34 def (attribute_name) "#{self_link}/#{format_name_for_link(attribute_name)}" end |
#relationship_self_link(attribute_name) ⇒ Object
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 |
#self_link ⇒ Object
26 27 28 |
# File 'lib/jsonapi/ember_serializer.rb', line 26 def self_link "#{base_url}/#{type_for_link}/#{id}" end |
#type ⇒ Object
18 19 20 |
# File 'lib/jsonapi/ember_serializer.rb', line 18 def type object.class.name.demodulize.underscore.dasherize end |