class Bookafy::Company

Public Class Methods

new() click to toggle source
Calls superclass method Bookafy::BaseService::new
# File lib/bookafy/company.rb, line 4
def initialize
  super
end

Public Instance Methods

info() click to toggle source
# File lib/bookafy/company.rb, line 12
def info()
  response = get(uri)
  unless response.code == 200
    return nil
  end

  response_json = JSON.parse(response.body)['response']
  company_json = response_json['company']
  company = Bookafy::Model::Company.new(company_json)

  company
rescue => e
  puts "Error at fetching customers: #{e.message}"
  return nil
end
uri() click to toggle source
# File lib/bookafy/company.rb, line 8
def uri
  'company'
end