class Ecoportal::API::Internal::PolicyGroups
@attr_reader client [Common::Client] a `Common::Client` object that holds the configuration of the api connection.
Attributes
client[R]
Public Class Methods
new(client)
click to toggle source
@param client [Common::Client] a `Common::Client` object that holds the configuration of the api connection. @return [PolicyGroups] an instance object ready to make policy groups api requests.
# File lib/ecoportal/api/internal/policy_groups.rb, line 12 def initialize(client) @client = client end
Public Instance Methods
each(&block)
click to toggle source
# File lib/ecoportal/api/internal/policy_groups.rb, line 23 def each(&block) return to_enum(:each) unless block get_all.each(&block) end
get_all()
click to toggle source
Gets all the policy groups via api request. @return [Enumerable<PolicyGroup>] an `Enumerable` with all the policy groups already wrapped as `PolicyGroup` objects.
# File lib/ecoportal/api/internal/policy_groups.rb, line 18 def get_all response = client.get("/policy_groups") Common::WrappedResponse.new(response, Internal::PolicyGroup) end