sendregning 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/sendregning/invoice.rb +7 -15
- data/lib/sendregning/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc6f997dcd481f5713e113f3f10805359e10aab8
|
4
|
+
data.tar.gz: fc89a4e0e1262b00803aff4d348009ad8bf550b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fce9bb3804d9194b6fa826bec419b557b0224207b8a04e5378c9492ca9b783e251bb1339d41bb0a85b8b48d4b3182d5d0c78c6d3c26328b855f8d15deceec39a
|
7
|
+
data.tar.gz: e97edf4f3420b455eb51d4ff8e53f7eb03a5856f3ec0071a091f539f7cf5563f980663cc72160dc67db6b6e73d3d25eccce97afe394cd6c3550b0135904efb75
|
data/README.md
CHANGED
data/lib/sendregning/invoice.rb
CHANGED
@@ -69,36 +69,28 @@ module Sendregning
|
|
69
69
|
|
70
70
|
protected
|
71
71
|
|
72
|
+
def filter_attributes(attributes, filter)
|
73
|
+
attributes.dup.delete_if { |k, v| !filter.include?(k.to_sym) }
|
74
|
+
end
|
75
|
+
|
72
76
|
def optional=(attributes)
|
73
77
|
@optional ||= {}
|
74
|
-
attributes
|
75
|
-
@optional[key.to_sym] = value if OPTIONAL_ATTRIBUTES.include?(key.to_sym)
|
76
|
-
end
|
77
|
-
@optional
|
78
|
+
@optional.merge!(filter_attributes(attributes, OPTIONAL_ATTRIBUTES))
|
78
79
|
end
|
79
80
|
|
80
81
|
def shipment=(attributes)
|
81
82
|
@shipment ||= {}
|
82
|
-
attributes
|
83
|
-
@shipment[key.to_sym] = value if SHIPMENT_ATTRIBUTES.include?(key.to_sym)
|
84
|
-
end
|
85
|
-
@shipment
|
83
|
+
@shipment.merge!(filter_attributes(attributes, SHIPMENT_ATTRIBUTES))
|
86
84
|
end
|
87
85
|
|
88
86
|
def method_missing(method, *args)
|
89
87
|
if OPTIONAL_ATTRIBUTES.include?(method)
|
90
88
|
@optional[method]
|
91
89
|
elsif SHIPMENT_ATTRIBUTES.include?(method)
|
92
|
-
@
|
90
|
+
@shipment[method]
|
93
91
|
else
|
94
92
|
super
|
95
93
|
end
|
96
94
|
end
|
97
|
-
|
98
|
-
def xml_builder
|
99
|
-
xml = Builder::XmlMarkup.new(:indent=>2)
|
100
|
-
xml.instruct! :xml, :version=>"1.0", :encoding=>"UTF-8"
|
101
|
-
xml
|
102
|
-
end
|
103
95
|
end
|
104
96
|
end
|
data/lib/sendregning/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sendregning
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Inge Jørgensen
|
@@ -91,8 +91,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
91
91
|
version: '0'
|
92
92
|
requirements: []
|
93
93
|
rubyforge_project:
|
94
|
-
rubygems_version: 2.
|
94
|
+
rubygems_version: 2.4.1
|
95
95
|
signing_key:
|
96
96
|
specification_version: 4
|
97
97
|
summary: Ruby client for the SendRegning Web Service
|
98
98
|
test_files: []
|
99
|
+
has_rdoc:
|