Class: Flexibee::Client
- Inherits:
-
Object
- Object
- Flexibee::Client
- 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
- #get(url, params = {}, filter = nil) ⇒ Object
-
#initialize(user_id, login, password, company_id) ⇒ Client
constructor
A new instance of Client.
Methods included from OrderType
Methods included from InvoiceType
Methods included from Product
Methods included from Company
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, login, password, company_id) @user_id = user_id @login = 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 |