Skip to content
This repository has been archived by the owner on Jan 5, 2021. It is now read-only.

What does pagination_data do? #14

Open
markgaensicke opened this issue Aug 18, 2016 · 0 comments
Open

What does pagination_data do? #14

markgaensicke opened this issue Aug 18, 2016 · 0 comments

Comments

@markgaensicke
Copy link

I have trouble understanding what the output of this method should be (and, well, the transformations that take place in that method). Can somebody explain please?

      def pagination_data(resource, key)
        keys = [:pagination, key]

        [resource.data, resource.metadata[:options]].inject(nil) do |result, data_source|
          result or keys.inject(data_source) { |source, key| source.try(:[], key) }
        end
      end

pageable.rb#L64

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant