Class: Flexibee::Client

Inherits:
Object
  • Object
show all
Includes:
Company, InvoiceType, OrderType, Product
Defined in:
lib/flexibee/client.rb,
lib/flexibee/client/company.rb,
lib/flexibee/client/product.rb,
lib/flexibee/client/order_type.rb,
lib/flexibee/client/invoice_type.rb

Defined Under Namespace

Modules: Company, InvoiceType, OrderType, Product

Instance Method Summary collapse

Methods included from OrderType

#order_types

Methods included from InvoiceType

#invoice_types

Methods included from Product

#product_list

Methods included from Company

#company_info

Constructor Details

#initialize(user_id, login, password, company_id) ⇒ Client

Returns a new instance of Client.



10
11
12
13
14
15
16
17
# File 'lib/flexibee/client.rb', line 10

def initialize(user_id, , password, company_id)
  @user_id = user_id
  @login = 
  @password = password
  @company_id = company_id

  @base_url = "https://#{login}:#{password}@#{user_id}.flexibee.eu:5434/c/#{company_id}"
end

Instance Method Details

#get(url, params = {}, filter = nil) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/flexibee/client.rb', line 19

def get(url, params = {}, filter = nil)
  unless filter.nil?
    url << '/' + URI::escape("(#{filter})")
  end
  url << '.json'
  JSON.parse(RestClient.get(url, params))
end