class Dhl::Bcs::V2::Receiver
Constants
- PROPERTIES
a location is one of
Address
,Packstation
,Postfiliale
orParcelShop
Public Class Methods
build(name: nil, **attributes)
click to toggle source
# File lib/dhl/bcs/v2/receiver.rb, line 9 def self.build(name: nil, **attributes) communication = Communication.build(attributes) location = Locator.for(attributes) new(attributes.merge(name: name, communication: communication, location: location)) end
new(**attributes)
click to toggle source
# File lib/dhl/bcs/v2/receiver.rb, line 15 def initialize(**attributes) attributes.each do |property, value| send("#{property}=", value) if PROPERTIES.include?(property) end end
Public Instance Methods
to_soap_hash()
click to toggle source
# File lib/dhl/bcs/v2/receiver.rb, line 21 def to_soap_hash { 'cis:name1' => name, 'Communication' => communication.to_soap_hash, location.class.name.split('::').last => location.to_soap_hash } end