Sha256: b8d493a4768044547eaec286d934d7522e6624792ab259787a14de70675dc2df
Contents?: true
Size: 1.07 KB
Versions: 15
Compression:
Stored size: 1.07 KB
Contents
module Ecoportal module API class Internal # @attr_reader client [Common::Client] a `Common::Client` object that holds the configuration of the api connection. class PolicyGroups include Enumerable attr_reader :client # @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. def initialize(client) @client = client end # Gets all the policy groups via api request. # @return [Enumerable<PolicyGroup>] an `Enumerable` with all the policy groups already wrapped as `PolicyGroup` objects. def get_all response = client.get("/policy_groups") Common::WrappedResponse.new(response, Internal::PolicyGroup) end def each(&block) return to_enum(:each) unless block get_all.each(&block) end end end end end require 'ecoportal/api/internal/policy_group'
Version data entries
15 entries across 15 versions & 1 rubygems