elibri_onix 0.2.6 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,7 +6,8 @@ module Elibri
6
6
 
7
7
  #Class representing ONIX header
8
8
  class Header
9
-
9
+ include Inspector
10
+
10
11
  #date, at which message was sent
11
12
  attr_accessor :sent_date_time
12
13
 
@@ -23,7 +24,12 @@ module Elibri
23
24
 
24
25
  #:nodoc:
25
26
  RELATIONS = []
26
-
27
+
28
+ #:nodoc:
29
+ def inspect_include_fields
30
+ [:sender]
31
+ end
32
+
27
33
  def initialize(data)
28
34
  @to_xml = data.to_s
29
35
  @sent_date_time = Date.parse(data.xpath('xmlns:SentDateTime').try(:text)) if data.xpath('xmlns:SentDateTime')
@@ -5,6 +5,8 @@ module Elibri
5
5
 
6
6
  #class representing whole ONIX response from eLibri server
7
7
  class ONIXMessage
8
+ include Inspector
9
+
8
10
  #list of all products returned in this mnessage
9
11
  attr_accessor :products
10
12
 
@@ -31,7 +33,12 @@ module Elibri
31
33
  RELATIONS = [
32
34
  :products
33
35
  ]
36
+
37
+ def inspect_include_fields
38
+ [:header, :elibri_dialect, :release, :products]
39
+ end
34
40
 
41
+
35
42
  def self.from_xml(data, *initialization_args)
36
43
  Kernel.warn "[DEPRECATION] `from_xml` is deprecated. Please use `new` instead."
37
44
  self.new(data, *initialization_args)
@@ -5,7 +5,8 @@ module Elibri
5
5
 
6
6
  #Sender of the message
7
7
  class Sender
8
-
8
+ include Inspector
9
+
9
10
  #name of company, which sent the message
10
11
  attr_accessor :sender_name
11
12
 
@@ -25,6 +26,11 @@ module Elibri
25
26
 
26
27
  #:nodoc:
27
28
  RELATIONS = []
29
+
30
+ #:nodoc:
31
+ def inspect_include_fields
32
+ [:sender_name, :contact_name, :email_address]
33
+ end
28
34
 
29
35
  def initialize(data)
30
36
  @to_xml = data.to_s
@@ -2,7 +2,7 @@ module Elibri
2
2
  module ONIX
3
3
  z = $VERBOSE
4
4
  $VERBOSE = nil
5
- VERSION = "0.2.6"
5
+ VERSION = "0.2.7"
6
6
  Version = VERSION
7
7
  $VERBOSE = z
8
8
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elibri_onix
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 6
10
- version: 0.2.6
9
+ - 7
10
+ version: 0.2.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Marcin Urbanski