caren-api 0.4.26 → 0.4.27

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/caren-api.gemspec +1 -1
  3. data/lib/caren/billable.rb +22 -24
  4. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.26
1
+ 0.4.27
data/caren-api.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "caren-api"
8
- s.version = "0.4.26"
8
+ s.version = "0.4.27"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Andre Foeken"]
@@ -1,5 +1,5 @@
1
1
  class Caren::Billable < Caren::Base
2
-
2
+
3
3
  def self.keys
4
4
  [ :id, # Integer (Id of this product in Caren)
5
5
  :external_id, # Integer (Your id)
@@ -26,35 +26,34 @@ class Caren::Billable < Caren::Base
26
26
  :plannable_margin_before, # Integer (in seconds)
27
27
  :plannable_margin_after, # Integer (in seconds)
28
28
  :plannable_max_duration, # Integer (in seconds)
29
- :valid_from, # Date
30
- :valid_to # Date
29
+ :available # Boolean
31
30
  ] + super
32
31
  end
33
-
32
+
34
33
  def self.search key, value, session
35
34
  from_xml session.get( self.search_url(key,value) )
36
35
  end
37
-
36
+
38
37
  def self.find id, session
39
38
  from_xml session.get(self.resource_url(id))
40
39
  end
41
-
40
+
42
41
  def self.all session
43
42
  from_xml session.get(self.resource_url)
44
43
  end
45
-
44
+
46
45
  def create session
47
46
  self.class.from_xml session.post(self.resource_url, self.to_xml)
48
47
  end
49
-
48
+
50
49
  def update session
51
50
  self.class.from_xml session.put(self.resource_url(self.id), self.to_xml)
52
51
  end
53
-
52
+
54
53
  def update_photo photo_hash_or_path, session
55
54
  self.class.from_xml session.put(self.resource_url(self.id), self.to_photo_xml(photo_hash_or_path))
56
55
  end
57
-
56
+
58
57
  def as_xml
59
58
  { :name => self.name,
60
59
  :description => self.description,
@@ -64,25 +63,24 @@ class Caren::Billable < Caren::Base
64
63
  :photo => self.photo,
65
64
  :price_with_vat_in_cents => self.price_with_vat_in_cents,
66
65
  :currency => self.currency,
67
- :type => self.type,
66
+ :type => self.type,
68
67
  :rounding => self.rounding,
69
68
  :vat_promillage => self.vat_promillage,
70
69
  :external_id => self.external_id,
71
70
  :piece_duration => self.piece_duration,
72
71
  :min_amount => self.min_amount,
73
72
  :default_amount => self.default_amount,
74
- :send_reminder_subject => self.send_reminder_subject,
75
- :send_reminder_person => self.send_reminder_person,
73
+ :send_reminder_subject => self.send_reminder_subject,
74
+ :send_reminder_person => self.send_reminder_person,
76
75
  :send_reminder_in_advance => self.send_reminder_in_advance,
77
76
  :plannable_by_subject => self.plannable_by_subject,
78
- :plannable_margin_before => self.plannable_margin_before,
79
- :plannable_margin_after => self.plannable_margin_after,
80
- :plannable_max_duration => self.plannable_max_duration,
81
- :valid_from => self.valid_from,
82
- :valid_to => self.valid_to
77
+ :plannable_margin_before => self.plannable_margin_before,
78
+ :plannable_margin_after => self.plannable_margin_after,
79
+ :plannable_max_duration => self.plannable_max_duration,
80
+ :available => self.available
83
81
  }
84
82
  end
85
-
83
+
86
84
  def to_photo_xml photo_hash_or_path
87
85
  builder = Builder::XmlMarkup.new
88
86
  photo = self.class.hash_from_image(photo_hash_or_path)
@@ -90,17 +88,17 @@ class Caren::Billable < Caren::Base
90
88
  billable.tag!("photo", photo[:content], "name" => photo[:name], "content-type" => photo[:content_type] ) if photo
91
89
  end
92
90
  end
93
-
91
+
94
92
  def self.array_root
95
93
  :billables
96
94
  end
97
-
95
+
98
96
  def self.node_root
99
97
  :billable
100
98
  end
101
-
99
+
102
100
  def self.resource_location
103
101
  "/api/pro/store/billables"
104
102
  end
105
-
106
- end
103
+
104
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caren-api
3
3
  version: !ruby/object:Gem::Version
4
- hash: 59
4
+ hash: 57
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 26
10
- version: 0.4.26
9
+ - 27
10
+ version: 0.4.27
11
11
  platform: ruby
12
12
  authors:
13
13
  - Andre Foeken