Class: Ecoportal::API::Internal::PolicyGroups
- Inherits:
-
Object
- Object
- Ecoportal::API::Internal::PolicyGroups
- Includes:
- Enumerable
- Defined in:
- lib/ecoportal/api/internal/policy_groups.rb
Instance Attribute Summary collapse
-
#client ⇒ Common::Client
readonly
a
Common::Client
object that holds the configuration of the api connection.
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#get_all ⇒ Enumerable<PolicyGroup>
Gets all the policy groups via api request.
-
#initialize(client) ⇒ PolicyGroups
constructor
An instance object ready to make policy groups api requests.
Constructor Details
#initialize(client) ⇒ PolicyGroups
Returns an instance object ready to make policy groups api requests.
12 13 14 |
# File 'lib/ecoportal/api/internal/policy_groups.rb', line 12 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ Common::Client (readonly)
a Common::Client
object that holds the configuration of the api connection.
5 6 7 |
# File 'lib/ecoportal/api/internal/policy_groups.rb', line 5 def client @client end |
Instance Method Details
#each(&block) ⇒ Object
23 24 25 26 |
# 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 ⇒ Enumerable<PolicyGroup>
Gets all the policy groups via api request.
18 19 20 21 |
# 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 |