Class: Alchemy::ElementSerializer

Inherits:
ActiveModel::Serializer
  • Object
show all
Defined in:
app/serializers/alchemy/element_serializer.rb

Instance Method Summary collapse

Instance Method Details

#display_nameObject


24
25
26
# File 'app/serializers/alchemy/element_serializer.rb', line 24

def display_name
  object.display_name_with_preview_text
end

#ingredientsObject


20
21
22
# File 'app/serializers/alchemy/element_serializer.rb', line 20

def ingredients
  object.contents.collect(&:serialize)
end

#page_idObject


28
29
30
# File 'app/serializers/alchemy/element_serializer.rb', line 28

def page_id
  object.page.id
end