Class: B2bCenterApi::WebService::BaseType
- Inherits:
-
Object
- Object
- B2bCenterApi::WebService::BaseType
- Includes:
- TypeCast
- Defined in:
- lib/b2b_center_api/web_service/base_type.rb
Direct Known Subclasses
Types::ArrayOfIds, Types::AuctionData, Types::AuctionOffer, Types::AuctionParticipant, Types::B2bFile, Types::FirmData, Types::FirmInfo, Types::Lot, Types::TenderData, Types::TenderLotResult, Types::TenderLotResults, Types::TenderOffer, Types::TenderParticipant
Constant Summary collapse
- NO_INSPECT_ATTRS =
[:@soap_client]
Instance Attribute Summary collapse
-
#date_fields ⇒ Object
readonly
Returns the value of attribute date_fields.
-
#soap_client ⇒ Object
writeonly
Sets the attribute soap_client.
Instance Method Summary collapse
Methods included from TypeCast
Instance Attribute Details
#date_fields ⇒ Object (readonly)
Returns the value of attribute date_fields.
15 16 17 |
# File 'lib/b2b_center_api/web_service/base_type.rb', line 15 def date_fields @date_fields end |
#soap_client=(value) ⇒ Object (writeonly)
Sets the attribute soap_client
13 14 15 |
# File 'lib/b2b_center_api/web_service/base_type.rb', line 13 def soap_client=(value) @soap_client = value end |
Instance Method Details
#inspect ⇒ Object
19 20 21 22 23 24 25 |
# 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 ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 |
# 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 |