alpha_card 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 69ecf71ff5367ce0a63a519ade5ba21a8cdce81c
4
- data.tar.gz: 582d9831fa7344b5c52ca4b1c93b30044c27ff24
3
+ metadata.gz: ceec62767933ce8b3848b21ec0ffbe6c9775f229
4
+ data.tar.gz: 82c414eea55aa6d675d0c1043cba408eb21af70a
5
5
  SHA512:
6
- metadata.gz: b9fd3179c4edad7500d6d280a56ab61fcd125e39e1469618271d951b94a53a837a1b4f5cf101b4a4793c170c974fb208b86bd5800ee1b6f848977df3f85bf3da
7
- data.tar.gz: 91ce299981bb899e15bab63279ae58a7ef3575a3b525160d790328d406a899af0c9601df3c2fc2484c5bfd0403ae9cf55fbecb8c69ba52e0ad2562fa752bdf39
6
+ metadata.gz: dac21d71195b11f35c375c1ea0743cf033f33e81eaa61ce639fdc5aedecf6ac5450ad139527233e18484fdb0a1ebccb223d843ef296a6b416318f84f16d547e2
7
+ data.tar.gz: 3e713b2ccbd597e73a1f4c6bcc0faedab7e49e5fb9ec3319b3812d34c8fd74d1ecf3c3e78464df9c34bce9815f6daacc5c474caefca33a887cf7b8b4b613569e
@@ -1,6 +1,10 @@
1
+ $:.unshift(File.join(File.dirname(__FILE__), 'lib'))
2
+
3
+ require 'alpha_card/version'
4
+
1
5
  Gem::Specification.new do |gem|
2
6
  gem.name = 'alpha_card'
3
- gem.version = '0.2.1'
7
+ gem.version = AlphaCard::VERSION
4
8
  gem.date = '2014-07-11'
5
9
  gem.summary = 'Alpha Card Services DirectPost API for Ruby'
6
10
  gem.description = 'Gem for creating sales with Alpha Card Services DirectPost API'
@@ -3,13 +3,18 @@ require 'yaml'
3
3
  require 'virtus'
4
4
  require 'rest_client'
5
5
 
6
+ # Version
7
+ require 'alpha_card/version'
8
+
6
9
  require 'alpha_card/utils'
7
10
  require 'alpha_card/alpha_card_object'
8
11
  require 'alpha_card/alpha_card_response'
9
12
 
13
+ # Errors
10
14
  require 'alpha_card/errors/alpha_card_error'
11
15
  require 'alpha_card/errors/api_connection_error'
12
16
 
17
+ # Alpha Card Resources
13
18
  require 'alpha_card/account'
14
19
  require 'alpha_card/shipping'
15
20
  require 'alpha_card/billing'
@@ -30,7 +35,7 @@ module AlphaCard
30
35
  CREDIT_CARD_CODES ||= YAML.load_file(File.expand_path('../alpha_card/data/credit_card_codes.yml', __FILE__))
31
36
 
32
37
  class << self
33
- # @return [String] Alpha Card Gateway DirectPost API URL.
38
+ # @return [String] Alpha Card Gateway DirectPost API URL.
34
39
  attr_accessor :api_base
35
40
  end
36
41
 
@@ -13,5 +13,23 @@ module AlphaCard
13
13
  attribute :zip_code, String
14
14
  attribute :country, String
15
15
  attribute :email, String
16
+
17
+ ##
18
+ # Overloaded <code>filled_attributes</code> method from
19
+ # <code>AlphaCard::AlphaCardObject</code>. All attributes of
20
+ # the Alpha Card Shipping object must start with "shipping_"
21
+ # prefix.
22
+ #
23
+ # @return [Hash] attributes
24
+ # Only filled attributes of Shipping resource with "shipping_" prefix.
25
+ #
26
+ # @example
27
+ # shipping = AlphaCard::Shipping.new({firstname: 'John', state: 'NY'})
28
+ # shipping.filled_attributes
29
+ #
30
+ # #=> {shipping_firstname: 'John', shipping_state: 'NY'}
31
+ def filled_attributes
32
+ Hash[super.map {|k, v| ["shipping_#{k}".to_sym, v] }]
33
+ end
16
34
  end
17
35
  end
@@ -0,0 +1,5 @@
1
+ module AlphaCard
2
+ ##
3
+ # Version information for AlphaCard gem.
4
+ VERSION = '0.2.2'
5
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alpha_card
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nikita Bulaj
@@ -78,6 +78,7 @@ files:
78
78
  - lib/alpha_card/sale.rb
79
79
  - lib/alpha_card/shipping.rb
80
80
  - lib/alpha_card/utils.rb
81
+ - lib/alpha_card/version.rb
81
82
  - spec/alpha_card/alpha_card_account_spec.rb
82
83
  - spec/alpha_card/alpha_card_response_spec.rb
83
84
  - spec/alpha_card/alpha_card_spec.rb