Class: Decidim::EnhancedTextwork::ParagraphsType

Inherits:
Api::Types::BaseObject
  • Object
show all
Defined in:
lib/decidim/api/paragraphs_type.rb

Instance Method Summary collapse

Instance Method Details

#paragraph(id:) ⇒ Object



38
39
40
# File 'lib/decidim/api/paragraphs_type.rb', line 38

def paragraph(id:)
  Decidim::EnhancedTextwork::ParagraphFinderHelper.new(model_class: Paragraph).call(object, { id: id }, context)
end

#paragraphs(filter: {}, order: {}) ⇒ Object



34
35
36
# File 'lib/decidim/api/paragraphs_type.rb', line 34

def paragraphs(filter: {}, order: {})
  Decidim::EnhancedTextwork::ParagraphListHelper.new(model_class: Paragraph).call(object, { filter: filter, order: order }, context)
end