class B2bCenterApi::WebService::BaseType
Constants
- NO_INSPECT_ATTRS
Attributes
date_fields[R]
soap_client[W]
Private Class Methods
to_array(obj)
click to toggle source
# File lib/b2b_center_api/web_service/base_type.rb, line 62 def self.to_array(obj) obj.is_a?(Hash) ? [obj] : obj end
Public Instance Methods
inspect()
click to toggle source
# File lib/b2b_center_api/web_service/base_type.rb, line 19 def inspect vars = instance_variables NO_INSPECT_ATTRS.each { |a| vars.delete(a) } vars = vars.map { |v| "#{v}=#{instance_variable_get(v).inspect}" } vars = vars.join(', ') "<#{self.class}: #{vars}>" end
to_h()
click to toggle source
# File lib/b2b_center_api/web_service/base_type.rb, line 27 def to_h hash = {} vars = instance_variables NO_INSPECT_ATTRS.each { |a| vars.delete(a) } vars.each { |var| hash[var.to_s.delete('@').to_sym] = instance_variable_get(var) } date_fields.each { |d| hash[d] = parse_date(hash[d]) } if date_fields hash end
Private Instance Methods
parse_date(date)
click to toggle source
# File lib/b2b_center_api/web_service/base_type.rb, line 53 def parse_date(date) if date.is_a? Date return date.strftime("%d.%m.%Y") elsif date.is_a? Time return date.strftime('%d.%m.%Y %H:%M') end date end
remote_auction()
click to toggle source
# File lib/b2b_center_api/web_service/base_type.rb, line 41 def remote_auction B2bCenterApi::RemoteAuction.new(@soap_client) end
remote_market()
click to toggle source
# File lib/b2b_center_api/web_service/base_type.rb, line 45 def remote_market B2bCenterApi::RemoteMarket.new(@soap_client) end
remote_tender()
click to toggle source
# File lib/b2b_center_api/web_service/base_type.rb, line 49 def remote_tender B2bCenterApi::RemoteTender.new(@soap_client) end