api-moip-assinaturas 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZGJlYTgyNTAwZTVjMWE2ZjkxOGM3MmM5ZDAxYTNhMTVkY2RmOTZiYw==
4
+ MWI1MWFlODcwMTlmZTRkZjEzYzJhMTJlNDcxY2Q2ZThhN2Y5MDU3YQ==
5
5
  data.tar.gz: !binary |-
6
- MmE3NTZlZDEyYmVkZjZlZjFjMmIzNGIwOWJlMThhMzY5OGI2OTdjZQ==
6
+ NzA4MzcxMjU4ZjRkZjVjZTliYTVkMWFhYjFjN2M5ZTkzMzRjZjViYQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MDAzMTFkZTA2MWEyZWY5ODRjMmExZTE4ODZjNTgyYzVhYWU3NDVmOWExMzM2
10
- MTY2MzY0Yzg2MzQ2ZjdlYjM4OTAwZDNmODY3OTMxYmU3ZmNlMjQzNDg2ZGUy
11
- MzVmNDZkM2Y0MmE0MmZiZmRlODFhMTM5ZjQ1ZjFiYWQ3NDMwNTk=
9
+ NTJlMmUyNTQ1NGY0NjZlM2MzNTMwYzJhMGU4ZWI1NDlkNzEzMjY1MTM4NGRl
10
+ Y2M1NDhjNzJjOWMxNDEwZmJkZmQzMWI3OTgzY2I1MWM0ZjhkNjRlMWMxMWYx
11
+ MzMyNWYxM2ZmNTFlOGY3MjIxYTI0ZGYwNTk3NDNlNzM3MzVjMDY=
12
12
  data.tar.gz: !binary |-
13
- YmU5MmU5MTBiZWQ1ZjQ3MTdhY2VhZDI0NjA2OTYyOTRhYTkwMDViOTFiYTg3
14
- YTU2YjZkZGQ3ZjEwMGM3NzVmODE5ZGY3ODRkMmJkYmIwZTBhYjc0MTNhNDRm
15
- MTdjYmFlYjdiZTA5NmQ3NGRjZTZkZTQ2YWFiMTA3MzM4YmIwYzM=
13
+ NjYyMGVhYzMyYWY4MzkzZDM5ODY1ZjdjZmU2NWMwZjJlYzQ3Y2FmYzQyNTcw
14
+ NGVjZTE4NjE4ZGFmM2QzMTg0NDllMmJmZmRkOTAzNzU3ZGYwMTdkOTFlZGIz
15
+ ZTZhYjhlZDY4ZTA2YjdkYzkwYTA2NDczODYwNjBmNmIxMTg2NmQ=
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'api-moip-assinaturas'
3
- s.version = '0.0.4'
3
+ s.version = '0.0.5'
4
4
  s.date = '2013-06-05'
5
5
  s.summary = "Moip Assinaturas by Pixxel"
6
6
  s.description = "Gem desenvolvida para atender aos requisitos do moip api de assinaturas"
@@ -13,4 +13,5 @@ Gem::Specification.new do |s|
13
13
  s.required_rubygems_version = '>= 1.8.11'
14
14
  s.add_development_dependency 'httparty', '~> 0.11.0', '>= 0.11.0'
15
15
  s.add_development_dependency 'json', '~> 1.7.7', '>= 1.7.7'
16
+ s.add_development_dependency 'activemodel', '~> 3.2.12', '>= 3.2.12'
16
17
  end
@@ -3,6 +3,8 @@ end
3
3
 
4
4
  # imports para o statup
5
5
  require "httparty"
6
+ require "json"
7
+ require "activemodel"
6
8
  require "moip/configuration"
7
9
  require "moip/header"
8
10
  require "moip/webhooks"
@@ -1,12 +1,29 @@
1
- class Moip::Plan
1
+ # encoding: utf-8
2
+ class Plan
2
3
  include HTTParty
3
4
  include Moip::Header
5
+ include ActiveModel::Validations
6
+ include ActiveModel::Serialization
4
7
 
8
+ # see http://moiplabs.github.io/assinaturas-docs/api.html#criar_plano
9
+ attr_accessor :code, :name, :description, :amount,
10
+ :setup_fee, :interval, :billing_cycles,
11
+ :status, :max_qty
12
+
13
+ validates :code, :name, :description, :amount, :presence => true
14
+
15
+ # metodo que cria o objeto plano
16
+ def self.build_new params
17
+ end
18
+
19
+ # see http://moiplabs.github.io/assinaturas-docs/api.html#listar_plano
5
20
  def list
6
- self.class.get(base_url(:plans), default_header)
21
+ self.class.get(base_url(:plans), default_header).parsed_response
7
22
  end
8
23
 
9
- def create
24
+ # metodo que envia as informações para a API do moip e cria um novo plano
25
+ # see http://moiplabs.github.io/assinaturas-docs/api.html#criar_plano
26
+ def create params
10
27
  # todo: the create
11
28
  end
12
29
 
@@ -17,5 +34,15 @@ class Moip::Plan
17
34
  def delete
18
35
  # todo: the delete
19
36
  end
37
+
38
+ def interval= options = {}
39
+ @interval = {}
40
+ @interval.merge! :length => options[:length]
41
+ @interval.merge! :unit => options[:unit]
42
+ end
43
+
44
+ def to_json
45
+
46
+ end
20
47
 
21
- end
48
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api-moip-assinaturas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Douglas Rossignolli
@@ -50,6 +50,26 @@ dependencies:
50
50
  - - ! '>='
51
51
  - !ruby/object:Gem::Version
52
52
  version: 1.7.7
53
+ - !ruby/object:Gem::Dependency
54
+ name: activemodel
55
+ requirement: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ~>
58
+ - !ruby/object:Gem::Version
59
+ version: 3.2.12
60
+ - - ! '>='
61
+ - !ruby/object:Gem::Version
62
+ version: 3.2.12
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ~>
68
+ - !ruby/object:Gem::Version
69
+ version: 3.2.12
70
+ - - ! '>='
71
+ - !ruby/object:Gem::Version
72
+ version: 3.2.12
53
73
  description: Gem desenvolvida para atender aos requisitos do moip api de assinaturas
54
74
  email: douglas@pixxel.net.br
55
75
  executables: []