fakturownia 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,2 +1,5 @@
1
+ 0.0.2
2
+ * Methods for clients
3
+
1
4
  0.0.1
2
5
  * Initial release.
@@ -98,6 +98,33 @@ module Fakturownia
98
98
  http.delete(whole_url)
99
99
  end
100
100
 
101
+
102
+ # Get all clients in XML
103
+ def self.clients
104
+ endpoint = "https://#{Fakturownia.account_name}.fakturownia.pl/clients.xml"
105
+ response = self.make_get_request(endpoint)
106
+
107
+ (response.code == '200') ? response.body : nil
108
+ end
109
+
110
+ # Get client based on client_id
111
+ # Return in XML
112
+ def self.client client_id
113
+ endpoint = "https://#{Fakturownia.account_name}.fakturownia.pl/clients/#{client_id}.xml"
114
+ response = self.make_get_request(endpoint)
115
+
116
+ (response.code == '200') ? response.body : nil
117
+ end
118
+
119
+ # Get client based on email and password
120
+ # Return in XML
121
+ def self.client_by_email_and_password email, password
122
+ endpoint = "https://#{Fakturownia.account_name}.fakturownia.pl/clients/check"
123
+ response = self.make_get_request(endpoint, { :email => email, :password => password })
124
+
125
+ (response.code == '200' and response.body.to_s != 'brak klienta') ? response.body : nil
126
+ end
127
+
101
128
 
102
129
  # Make GET request returning response
103
130
  def self.make_get_request endpoint, additional_params = {}
@@ -1,3 +1,3 @@
1
1
  module Fakturownia
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fakturownia
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-11 00:00:00.000000000 Z
12
+ date: 2013-06-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -94,7 +94,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
94
94
  version: '0'
95
95
  segments:
96
96
  - 0
97
- hash: 2964144164709439946
97
+ hash: 2331183322955811531
98
98
  required_rubygems_version: !ruby/object:Gem::Requirement
99
99
  none: false
100
100
  requirements: