Class: Fabricio::Service::OrganizationService
- Inherits:
-
Object
- Object
- Fabricio::Service::OrganizationService
- Defined in:
- lib/fabricio/services/organization_service.rb
Overview
Service responsible for fetching different Organization information
Instance Method Summary collapse
-
#get ⇒ Fabricio::Model::Organization
Obtains current organization information.
-
#initialize(session, network_client) ⇒ Fabricio::Service::OrganizationService
constructor
Initializes a new OrganizationService object.
Constructor Details
#initialize(session, network_client) ⇒ Fabricio::Service::OrganizationService
Initializes a new OrganizationService object.
15 16 17 18 19 20 |
# File 'lib/fabricio/services/organization_service.rb', line 15 def initialize(session, network_client) @session = session @request_model_factory = Fabricio::Networking::OrganizationRequestModelFactory.new @network_client = network_client end |
Instance Method Details
#get ⇒ Fabricio::Model::Organization
Obtains current organization information
25 26 27 28 29 30 |
# File 'lib/fabricio/services/organization_service.rb', line 25 def get request_model = @request_model_factory.get_organization_request_model response = @network_client.perform_request(request_model) puts(response) Fabricio::Model::Organization.new(JSON.parse(response.body)[0]) end |