Class: Ecoportal::API::Internal::PolicyGroups

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/ecoportal/api/internal/policy_groups.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ PolicyGroups

Returns a new instance of PolicyGroups.



7
8
9
# File 'lib/ecoportal/api/internal/policy_groups.rb', line 7

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



6
7
8
# File 'lib/ecoportal/api/internal/policy_groups.rb', line 6

def client
  @client
end

Instance Method Details

#each(&block) ⇒ Object



14
15
16
17
# File 'lib/ecoportal/api/internal/policy_groups.rb', line 14

def each(&block)
  return to_enum(:each) unless block
  get_all.each(&block)
end

#get_allObject



10
11
12
13
# File 'lib/ecoportal/api/internal/policy_groups.rb', line 10

def get_all
  response = @client.get("/policy_groups")
  Common::WrappedResponse.new(response, Internal::PolicyGroup)
end