iugu 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/iugu.rb +3 -0
- data/lib/iugu/api_resource.rb +2 -7
- data/lib/iugu/plan.rb +16 -0
- data/lib/iugu/plan_feature.rb +8 -0
- data/lib/iugu/plan_price.rb +8 -0
- data/lib/iugu/version.rb +1 -1
- metadata +16 -5
- checksums.yaml +0 -15
data/lib/iugu.rb
CHANGED
@@ -17,6 +17,9 @@ require_relative "iugu/payment_token"
|
|
17
17
|
require_relative "iugu/invoice"
|
18
18
|
require_relative "iugu/subscription"
|
19
19
|
require_relative "iugu/charge"
|
20
|
+
require_relative "iugu/plan"
|
21
|
+
require_relative "iugu/plan_price"
|
22
|
+
require_relative "iugu/plan_feature"
|
20
23
|
|
21
24
|
module Iugu
|
22
25
|
class AuthenticationException < StandardError
|
data/lib/iugu/api_resource.rb
CHANGED
@@ -30,13 +30,8 @@ module Iugu
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def self.object_base_uri
|
33
|
-
|
34
|
-
|
35
|
-
elsif self.object_type == "payment_method"
|
36
|
-
object_type = self.object_type + "s"
|
37
|
-
elsif self.object_type == "invoice"
|
38
|
-
object_type = self.object_type + "s"
|
39
|
-
elsif self.object_type == "subscription"
|
33
|
+
pluralized_models = ["customer", "payment_method", "invoice", "subscription", "plan"]
|
34
|
+
if pluralized_models.include? self.object_type
|
40
35
|
object_type = self.object_type + "s"
|
41
36
|
else
|
42
37
|
object_type = self.object_type
|
data/lib/iugu/plan.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
module Iugu
|
2
|
+
class Plan < APIResource
|
3
|
+
include Iugu::APIFetch
|
4
|
+
include Iugu::APICreate
|
5
|
+
include Iugu::APISave
|
6
|
+
include Iugu::APIDelete
|
7
|
+
|
8
|
+
def prices
|
9
|
+
APIChildResource.new({ plan_id: self.id }, Iugu::PlanPrice)
|
10
|
+
end
|
11
|
+
|
12
|
+
def features
|
13
|
+
APIChildResource.new({ plan_id: self.id }, Iugu::PlanFeature)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/lib/iugu/version.rb
CHANGED
metadata
CHANGED
@@ -1,18 +1,20 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iugu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Marcelo Paez Sequeira
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2014-
|
12
|
+
date: 2014-04-25 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: rest-client
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
16
18
|
requirements:
|
17
19
|
- - ! '>='
|
18
20
|
- !ruby/object:Gem::Version
|
@@ -20,6 +22,7 @@ dependencies:
|
|
20
22
|
type: :runtime
|
21
23
|
prerelease: false
|
22
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
23
26
|
requirements:
|
24
27
|
- - ! '>='
|
25
28
|
- !ruby/object:Gem::Version
|
@@ -27,6 +30,7 @@ dependencies:
|
|
27
30
|
- !ruby/object:Gem::Dependency
|
28
31
|
name: bundler
|
29
32
|
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
30
34
|
requirements:
|
31
35
|
- - ~>
|
32
36
|
- !ruby/object:Gem::Version
|
@@ -34,6 +38,7 @@ dependencies:
|
|
34
38
|
type: :development
|
35
39
|
prerelease: false
|
36
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
37
42
|
requirements:
|
38
43
|
- - ~>
|
39
44
|
- !ruby/object:Gem::Version
|
@@ -41,6 +46,7 @@ dependencies:
|
|
41
46
|
- !ruby/object:Gem::Dependency
|
42
47
|
name: rake
|
43
48
|
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
44
50
|
requirements:
|
45
51
|
- - ! '>='
|
46
52
|
- !ruby/object:Gem::Version
|
@@ -48,6 +54,7 @@ dependencies:
|
|
48
54
|
type: :development
|
49
55
|
prerelease: false
|
50
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
51
58
|
requirements:
|
52
59
|
- - ! '>='
|
53
60
|
- !ruby/object:Gem::Version
|
@@ -81,6 +88,9 @@ files:
|
|
81
88
|
- lib/iugu/object.rb
|
82
89
|
- lib/iugu/payment_method.rb
|
83
90
|
- lib/iugu/payment_token.rb
|
91
|
+
- lib/iugu/plan.rb
|
92
|
+
- lib/iugu/plan_feature.rb
|
93
|
+
- lib/iugu/plan_price.rb
|
84
94
|
- lib/iugu/search_result.rb
|
85
95
|
- lib/iugu/subscription.rb
|
86
96
|
- lib/iugu/utils.rb
|
@@ -91,26 +101,27 @@ files:
|
|
91
101
|
homepage: https://iugu.com
|
92
102
|
licenses:
|
93
103
|
- MIT
|
94
|
-
metadata: {}
|
95
104
|
post_install_message:
|
96
105
|
rdoc_options: []
|
97
106
|
require_paths:
|
98
107
|
- lib
|
99
108
|
required_ruby_version: !ruby/object:Gem::Requirement
|
109
|
+
none: false
|
100
110
|
requirements:
|
101
111
|
- - ! '>='
|
102
112
|
- !ruby/object:Gem::Version
|
103
113
|
version: '0'
|
104
114
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
115
|
+
none: false
|
105
116
|
requirements:
|
106
117
|
- - ! '>='
|
107
118
|
- !ruby/object:Gem::Version
|
108
119
|
version: '0'
|
109
120
|
requirements: []
|
110
121
|
rubyforge_project:
|
111
|
-
rubygems_version:
|
122
|
+
rubygems_version: 1.8.24
|
112
123
|
signing_key:
|
113
|
-
specification_version:
|
124
|
+
specification_version: 3
|
114
125
|
summary: Iugu API
|
115
126
|
test_files:
|
116
127
|
- test/lib/iugu/customer_test.rb
|
checksums.yaml
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
---
|
2
|
-
!binary "U0hBMQ==":
|
3
|
-
metadata.gz: !binary |-
|
4
|
-
ODllMTZhM2JiNDZhY2ZlM2NjZWFlZTUzNzE0NWYyMDUyOWVhNjRmMA==
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
OTQ3ZmZlYzQzYzUxOWZiYTU5NWQzYmQ2MDI3YTlmZmU5ZGY3ZDdlMA==
|
7
|
-
SHA512:
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
MjNiZmE1OWZlNGQ3Mzk5YWJmMmZjNmE3MDg0MWYyZDhhYWE4NzhjNTVhMTYy
|
10
|
-
NDk5NzVlOTYyY2Q0ZDg1NWJlODZlYjIxMDgxMzFkOTU0YmQ1ZTVkYTY1ZWIw
|
11
|
-
N2Y3MDA1YjczMjNhMDJlMWQ4N2Y5Yjg5MDU3YjA3NTMwNDk4OTE=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
NDkxYTI3MDFlMWY5ZjQzNGU1MDU1YTI1NzRiODUxZmY2YjhlMzhmZjdhZTA3
|
14
|
-
ODJhNzYxNjBkYTkyODVmYTJkNDJiMGEwOTE4MTM3ZDU4OTdmZGUxMTI5OWZj
|
15
|
-
NTA5ZDg2NDljYWJkNzkzNTNiNTg5MDQxNGRhZDgzNDgzZThiY2I=
|