class Wor::Paginate::Formatters::AmsFormatter
Public Instance Methods
serialized_content()
click to toggle source
# File lib/wor/paginate/formatters/ams_formatter.rb, line 9 def serialized_content return serializable_resource.new(paginated_content).as_json unless serializer.present? raise_dependency_error unless serializer.respond_to?('_attributes_data') paginated_content.map { |item| serializer.new(item, options) } end
Private Instance Methods
ams_defined?()
click to toggle source
# File lib/wor/paginate/formatters/ams_formatter.rb, line 21 def ams_defined? defined? serializable_resource end
raise_dependency_error()
click to toggle source
# File lib/wor/paginate/formatters/ams_formatter.rb, line 25 def raise_dependency_error raise Wor::Paginate::Exceptions::DependencyError end
serializable_resource()
click to toggle source
# File lib/wor/paginate/formatters/ams_formatter.rb, line 17 def serializable_resource ActiveModelSerializers::SerializableResource end