File Coverage

lib/eBay/API/XML/DataType/MeasureType.pm
Criterion Covered Total %
statement 7 9 77.7
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 10 12 83.3


line stmt bran cond sub pod time code
1             #!/usr/bin/perl
2              
3             package eBay::API::XML::DataType::MeasureType;
4              
5 1     1   1674 use strict;
  1         3  
  1         34  
6 1     1   5 use warnings;
  1         3  
  1         33  
7              
8             ##########################################################################
9             #
10             # Module: ............... eBay/API/XML
11             # File: ................. MeasureType.pm
12             # Generated by: ......... genEBayApiDataTypes.pl
13             # Last Generated: ....... 08/24/2008 16:44
14             # API Release Number: ... 579
15             #
16             ##########################################################################
17              
18             =head1 NAME
19              
20             eBay::API::XML::DataType::MeasureType
21              
22             =head1 DESCRIPTION
23              
24             Basic type for specifying measures and the system of measurement.
25             A decimal value (e.g., 10.25) is meaningful
26             as a measure when accompanied by a definition of the unit of measure (e.g., Pounds),
27             in which case the value specifies the quantity of that unit.
28             A MeasureType expresses both the value (a decimal) and, optionally, the unit and
29             the system of measurement.
30             Details such as shipping weights are specified as measure types.
31              
32              
33              
34             =head1 SYNOPSIS
35              
36             =cut
37              
38              
39             =head1 INHERITANCE
40              
41             eBay::API::XML::DataType::MeasureType inherits from the L class
42              
43             =cut
44              
45 1     1   69 use eBay::API::XML::BaseDataType;
  0            
  0            
46             our @ISA = ("eBay::API::XML::BaseDataType");
47              
48             use eBay::API::XML::DataType::Enum::MeasurementSystemCodeType;
49              
50              
51             my @gaProperties = ( [ 'content', 'xs:decimal', '', '', '' ]
52             );
53             push @gaProperties, @{eBay::API::XML::BaseDataType::getPropertiesList()};
54              
55             my @gaAttributes = ( [ 'measurementSystem', 'ns:MeasurementSystemCodeType', ''
56             ,'eBay::API::XML::DataType::Enum::MeasurementSystemCodeType', '' ]
57             , [ 'unit', 'xs:token', '', '', '' ]
58             );
59             push @gaAttributes, @{eBay::API::XML::BaseDataType::getAttributesList()};
60              
61             =head1 Subroutines:
62              
63             =cut
64              
65             sub new {
66             my $classname = shift;
67             my %args = @_;
68             my $self = $classname->SUPER::new(%args);
69             return $self;
70             }
71              
72             sub isScalar {
73             return 0;
74             }
75              
76              
77              
78             =head2 setValue()
79              
80             # Argument: 'xs:decimal'
81              
82             =cut
83              
84             sub setValue {
85             my $self = shift;
86             $self->{'content'} = shift
87             }
88              
89             =head2 getValue()
90              
91             # Returns: 'xs:decimal'
92              
93             =cut
94              
95             sub getValue {
96             my $self = shift;
97             return $self->{'content'};
98             }
99              
100              
101              
102              
103             =head2 setMeasurementSystem()
104              
105             The system of measurement (e.g., English).
106              
107             Calls: AddItem
108             RequiredInput: No
109              
110             # Argument: 'ns:MeasurementSystemCodeType'
111              
112             =cut
113              
114             sub setMeasurementSystem {
115             my $self = shift;
116             $self->{'measurementSystem'} = shift
117             }
118              
119             =head2 getMeasurementSystem()
120              
121             Calls: GetItem
122             Returned: Conditionally
123             Details: DetailLevel: none, ItemReturnDescription, ItemReturnAttributes, ReturnAll
124              
125             Calls: GetShippingDiscountProfiles
126             Returned: Conditionally
127              
128             # Returns: 'ns:MeasurementSystemCodeType'
129              
130             =cut
131              
132             sub getMeasurementSystem {
133             my $self = shift;
134             return $self->{'measurementSystem'};
135             }
136              
137              
138             =head2 setUnit()
139              
140             The unit of measure (e.g., lbs, oz, in). Currently ignored and assumed to be "inches"
141             when used as input for PackageDepth, PackageWidth, PackageLength, WeightMajor, WeightMinor.
142              
143             Calls: AddItem
144             RequiredInput: No
145              
146             # Argument: 'xs:token'
147              
148             =cut
149              
150             sub setUnit {
151             my $self = shift;
152             $self->{'unit'} = shift
153             }
154              
155             =head2 getUnit()
156              
157             Calls: GetItemShipping
158             GetSellerTransactions
159             GetShippingDiscountProfiles
160             Returned: Conditionally
161              
162             Calls: GetItem
163             Returned: Conditionally
164             Details: DetailLevel: none, ItemReturnDescription, ItemReturnAttributes, ReturnAll
165              
166             # Returns: 'xs:token'
167              
168             =cut
169              
170             sub getUnit {
171             my $self = shift;
172             return $self->{'unit'};
173             }
174              
175              
176              
177             ## Attribute and Property lists
178             sub getPropertiesList {
179             my $self = shift;
180             return \@gaProperties;
181             }
182              
183             sub getAttributesList {
184             my $self = shift;
185             return \@gaAttributes;
186             }
187              
188              
189              
190             1;