axiomus_api 0.1 → 0.1.1

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: 0b6d53d6c8cf127838ed4317dc3b09fd527018f9
4
- data.tar.gz: 56ea79ee658e40db0392160837f9beaa4116b90c
3
+ metadata.gz: 0e7e56548cb4b9fcbf06900faaa40e7203fea890
4
+ data.tar.gz: 3edb5f8eafc6c2fa1d8b5e87c374a337d27cac69
5
5
  SHA512:
6
- metadata.gz: 89295abdd43eee1f1fc84c3b784ac798b2ff14f32919bd7b2c2776ccee0b176061d83b9a840b09975b40dfa91e097c97cf28548b07ad8095ea249653f50576d3
7
- data.tar.gz: f071141c39d1a008c4fd907f8cc07a5902905e97bcc700293b6c731b82ded1c9e48125015e0e8fe7d54bfd953ada873c545c9f02978e83d891f8e4e3c0d724ed
6
+ metadata.gz: 0ff4fa6ae07e2371c0cbb4de8a79324b6a673297d83966e7c34e1544624de3cc52049372d01ade14a1f767c0e1edbbeea5aa5f40fc23abd9f414e18079987940
7
+ data.tar.gz: a1a9f6f7590ce9e78de3fab95eedc8566b2097f2846f145fb5f1aec27b59df8fc14488ab980756384d5599375e830b4286771d14d6abc2270c5a48eab2eeaeb4
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # Axiomus API
2
2
 
3
3
  [![Build Status](https://travis-ci.org/kinderly/axiomus_api.svg)](https://travis-ci.org/kinderly/axiomus_api)
4
+ [![Gem Version](https://badge.fury.io/rb/axiomus_api.png)](http://badge.fury.io/rb/axiomus_api)
4
5
  [![Coverage Status](https://coveralls.io/repos/kinderly/axiomus_api/badge.png)](https://coveralls.io/r/kinderly/axiomus_api)
5
6
  [![Code Climate](https://codeclimate.com/github/kinderly/axiomus_api.png)](https://codeclimate.com/github/kinderly/axiomus_api)
6
7
  [![Dependency Status](https://gemnasium.com/kinderly/axiomus_api.svg)](https://gemnasium.com/kinderly/axiomus_api)
@@ -112,7 +113,7 @@ Most orders use `AxiomusApi::Item` as their item type, but some don't. To safely
112
113
 
113
114
  ### Error handling
114
115
 
115
- Before sending a request, the library will validate your order object to check for missing fields or wrong type of parameters. If there are errors, it will raise an `AxiomusApi::Errors::ValidationError` exception. List of errors can be accessed via the order's `#validation_errors` method. Please note that passing validation doesn't neccesary means the order will be accepted by Axiomus.
116
+ Before sending a request, the library will validate your order object to check for missing fields or wrong type of parameters. If there are errors, it will raise an `AxiomusApi::Errors::ValidationError` exception. List of errors can be accessed via the order's `#validation_errors` method. Please note that passing validation doesn't necessarily mean the order will be accepted by Axiomus.
116
117
 
117
118
  If any kind of order request returns with an Axiomus status other than 0, the session will raise an `AxiomusApi::Errors::RequestError` exception.
118
119
 
@@ -4,7 +4,7 @@ require_relative '../services/post_services'
4
4
 
5
5
  class AxiomusApi::EmsOrder < AxiomusApi::BaseOrder
6
6
 
7
- xml_attribute :d_date
7
+ xml_attribute :b_date
8
8
  xml_attribute :incl_delivery_sum, optional: true
9
9
  xml_field :address, type: AxiomusApi::EmsAddress
10
10
  xml_field :services, type: AxiomusApi::PostServices
@@ -4,7 +4,7 @@ require_relative '../services/post_services'
4
4
 
5
5
  class AxiomusApi::PostOrder < AxiomusApi::BaseOrder
6
6
  #уточнить
7
- xml_attribute :d_date, :post_type
7
+ xml_attribute :b_date, :post_type
8
8
  xml_attribute :incl_delivery_sum, optional: true
9
9
  xml_field :address, type: AxiomusApi::PostAddress
10
10
  xml_field :services, type: AxiomusApi::PostServices
@@ -39,7 +39,7 @@ module AxiomusApi::Serializable
39
39
  private
40
40
 
41
41
  def obj_to_xml(xml, obj, xml_name = nil)
42
- if obj.respond_to?(:to_xml)
42
+ if obj.kind_of?(AxiomusApi::Base)
43
43
  xml << obj.to_xml(false, xml_name)
44
44
  elsif obj.kind_of?(Array)
45
45
  xml.send(xml_name) {
@@ -64,6 +64,10 @@ class AxiomusApi::Session
64
64
  order_response
65
65
  end
66
66
 
67
+ def labels_link(orders)
68
+ "http://axiomus.ru/system/control/_call.php?mode=label&order=#{orders.join(',')}"
69
+ end
70
+
67
71
  private
68
72
 
69
73
  def get_order_request(mode, order)
@@ -1,3 +1,3 @@
1
1
  module AxiomusApi
2
- VERSION = '0.1'
2
+ VERSION = '0.1.1'
3
3
  end
data/spec/factories.rb CHANGED
@@ -159,7 +159,7 @@ FactoryGirl.define do
159
159
  end
160
160
 
161
161
  factory :post_order, class: AxiomusApi::PostOrder, parent: :base_order do
162
- d_date {Time.now + rand(1..10)*24*60*60}
162
+ b_date {Time.now + rand(1..10)*24*60*60}
163
163
  post_type {rand(1..2)}
164
164
  address {build(:post_address)}
165
165
  services {build(:post_services)}
@@ -167,7 +167,7 @@ FactoryGirl.define do
167
167
  end
168
168
 
169
169
  factory :ems_order, class: AxiomusApi::EmsOrder, parent: :base_order do
170
- d_date {Time.now + rand(1..10)*24*60*60}
170
+ b_date {Time.now + rand(1..10)*24*60*60}
171
171
  address {build(:ems_address)}
172
172
  services {build(:post_services)}
173
173
  contacts {generate(:sms)}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: axiomus_api
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.1'
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kinderly LTD
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-30 00:00:00.000000000 Z
11
+ date: 2014-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri