geocerts 0.0.20 → 0.0.21

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.
@@ -6,7 +6,7 @@ more.
6
6
 
7
7
  == Simple example
8
8
 
9
- require 'geo_certs'
9
+ require 'geocerts'
10
10
 
11
11
  GeoCerts.partner_id = 'example'
12
12
  GeoCerts.api_token = 'abd123DEfg.....'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.20
1
+ 0.0.21
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{geocerts}
8
- s.version = "0.0.20"
8
+ s.version = "0.0.21"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["GeoCerts, Inc."]
12
- s.date = %q{2010-04-27}
12
+ s.date = %q{2010-04-30}
13
13
  s.description = %q{A Ruby library for interfacing with the GeoCerts REST API}
14
14
  s.email = %q{sslsupport@geocerts.com}
15
15
  s.extra_rdoc_files = [
@@ -22,7 +22,7 @@ module GeoCerts
22
22
  end
23
23
  end
24
24
 
25
- def to_geocerts_hash
25
+ def to_geocerts_hash #:nodoc:
26
26
  { :csr_body => GeoCerts.escape(self.body) }
27
27
  end
28
28
 
@@ -53,7 +53,7 @@ CERTIFICATE
53
53
  end
54
54
 
55
55
  action :reissue_certificate, :url => '/orders/:order_id/certificate/reissue.xml', :method => :post do
56
- parameter 'order[csr][body]', :as => :csr_body
56
+ parameter 'certificate[csr][body]', :as => :csr_body
57
57
  parser Parsers::OrderParser do
58
58
  element :certificate, :xpath => '/certificate' do
59
59
  eval(ELEMENTS)
@@ -70,12 +70,15 @@ module GeoCerts
70
70
  def response=(response) # :nodoc:
71
71
  @response = response
72
72
 
73
- if !response.respond_to?(:body)
74
- return @response
75
- elsif Hash.respond_to?(:from_xml)
76
- build_objects_for(Hash.from_xml(decode(response['content-encoding'], response.body)))
77
- else
78
- build_objects_for(parse_errors(decode(response['content-encoding'], response.body)))
73
+ begin
74
+ if !response.respond_to?(:body)
75
+ return @response
76
+ elsif Hash.respond_to?(:from_xml)
77
+ build_objects_for(Hash.from_xml(decode(response['content-encoding'], response.body)))
78
+ else
79
+ build_objects_for(parse_errors(decode(response['content-encoding'], response.body)))
80
+ end
81
+ rescue
79
82
  end
80
83
 
81
84
  @response
@@ -78,7 +78,11 @@ module GeoCerts
78
78
  rescue GeoCerts::AllowableExceptionWithResponse
79
79
  nil
80
80
  end
81
-
81
+
82
+ ##
83
+ # Returns a collection of Email addresses which may approve the given
84
+ # domain.
85
+ #
82
86
  def self.approvers(domain)
83
87
  response = call_api { GeoCerts.api.domain_approvers(:domain => domain) }
84
88
  collection = Collection.new
@@ -8,7 +8,7 @@ module GeoCerts
8
8
  #
9
9
  class Administrator < Contact
10
10
 
11
- def to_geocerts_hash
11
+ def to_geocerts_hash #:nodoc:
12
12
  {
13
13
  :administrator_first_name => GeoCerts.escape(self.first_name),
14
14
  :administrator_last_name => GeoCerts.escape(self.last_name),
@@ -5,7 +5,7 @@ module GeoCerts
5
5
  # Used for setting or retrieving the Contact information associated with a
6
6
  # GeoCerts::Order.
7
7
  #
8
- class Contact # :nodoc:all
8
+ class Contact
9
9
 
10
10
  attr_accessor :email,
11
11
  :first_name,
@@ -20,7 +20,7 @@ module GeoCerts
20
20
  end
21
21
  end
22
22
 
23
- def to_geocerts_hash
23
+ def to_geocerts_hash #:nodoc:
24
24
  raise(NotImplementedError)
25
25
  end
26
26
 
@@ -7,7 +7,7 @@ module GeoCerts
7
7
  #
8
8
  class ExtendedValidationApprover < Contact
9
9
 
10
- def to_geocerts_hash
10
+ def to_geocerts_hash #:nodoc:
11
11
  {
12
12
  :ev_approver_first_name => GeoCerts.escape(self.first_name),
13
13
  :ev_approver_last_name => GeoCerts.escape(self.last_name),
@@ -19,7 +19,7 @@ module GeoCerts
19
19
  end
20
20
  end
21
21
 
22
- def to_geocerts_hash
22
+ def to_geocerts_hash #:nodoc:
23
23
  {
24
24
  :organization_address => GeoCerts.escape(self.address),
25
25
  :organization_address_2 => GeoCerts.escape(self.address_2),
@@ -58,7 +58,7 @@ module GeoCerts
58
58
  })
59
59
  end
60
60
 
61
- def to_geocerts_hash
61
+ def to_geocerts_hash #:nodoc:
62
62
  { :product_sku => GeoCerts.escape(self.sku) }
63
63
  end
64
64
 
@@ -4,6 +4,13 @@ module GeoCerts
4
4
 
5
5
  class Reseller < ApiObject
6
6
 
7
+ ##
8
+ # Returns a Float of the reseller's available balance. This balance is
9
+ # for the user whose credentials are currently in use.
10
+ #
11
+ # >> GeoCerts::Reseller.balance
12
+ # => 5495.23
13
+ #
7
14
  def self.balance
8
15
  call_api { GeoCerts.api.balance }[:balance].to_f
9
16
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 20
9
- version: 0.0.20
8
+ - 21
9
+ version: 0.0.21
10
10
  platform: ruby
11
11
  authors:
12
12
  - GeoCerts, Inc.
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-27 00:00:00 -04:00
17
+ date: 2010-04-30 00:00:00 -04:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency