Class: Avm::EacGithubBase0::Api::Entity

Inherits:
EacRest::Entity
  • Object
show all
Defined in:
lib/avm/eac_github_base0/api/entity.rb

Direct Known Subclasses

Organization, Repository, Root

Instance Method Summary collapse

Instance Method Details

#all_from_list(entity_class, url_suffix) ⇒ Object



11
12
13
14
15
16
17
18
19
20
# File 'lib/avm/eac_github_base0/api/entity.rb', line 11

def all_from_list(entity_class, url_suffix)
  r = []
  while url_suffix.present?
    response = api.request_json(url_suffix).response
    r += response.body_data_or_raise
           .map { |child_data| child_entity(entity_class, child_data) }
    url_suffix = response.link('next')
  end
  r
end