Class: ECFS::Proceeding::ResultSet

Inherits:
Hash
  • Object
show all
Defined in:
lib/ecfs/proceeding.rb

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ ResultSet

Returns a new instance of ResultSet.



39
40
41
42
# File 'lib/ecfs/proceeding.rb', line 39

def initialize(params={})
  params["next_page_number"] = (params["constraints"]["page_number"].to_i + 1).to_s
  merge!(params)
end

Instance Method Details

#nextObject



54
55
56
# File 'lib/ecfs/proceeding.rb', line 54

def next
  next_query.get
end

#next_queryObject



44
45
46
47
48
49
50
51
52
# File 'lib/ecfs/proceeding.rb', line 44

def next_query
  query = ECFS::Proceeding.query
  self["constraints"].each_pair do |key, value|
    query.eq(key, value) unless key == "page_number"
  end
  query.constraints["page_number"] = self["next_page_number"]

  query
end