Class: ITunes::Store::Transporter::TransporterMessage
- Inherits:
-
Object
- Object
- ITunes::Store::Transporter::TransporterMessage
- Defined in:
- lib/itunes/store/transporter/errors.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
- #asset_error? ⇒ Boolean
-
#bad_data? ⇒ Boolean
1000…2000?.
-
#initialize(message, code = nil) ⇒ TransporterMessage
constructor
A new instance of TransporterMessage.
- #invalid_data? ⇒ Boolean
- #missing_data? ⇒ Boolean
- #schema_error? ⇒ Boolean
- #to_s ⇒ Object
- #unsupported_feature? ⇒ Boolean
- #validation_error? ⇒ Boolean
Constructor Details
#initialize(message, code = nil) ⇒ TransporterMessage
Returns a new instance of TransporterMessage.
25 26 27 28 |
# File 'lib/itunes/store/transporter/errors.rb', line 25 def initialize(, code = nil) @message = @code = code end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
22 23 24 |
# File 'lib/itunes/store/transporter/errors.rb', line 22 def code @code end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
23 24 25 |
# File 'lib/itunes/store/transporter/errors.rb', line 23 def @message end |
Instance Method Details
#asset_error? ⇒ Boolean
52 53 54 |
# File 'lib/itunes/store/transporter/errors.rb', line 52 def asset_error? (9000...10_000).include?(code) end |
#bad_data? ⇒ Boolean
1000…2000?
32 33 34 |
# File 'lib/itunes/store/transporter/errors.rb', line 32 def bad_data? (3000...4000).include?(code) end |
#invalid_data? ⇒ Boolean
36 37 38 |
# File 'lib/itunes/store/transporter/errors.rb', line 36 def invalid_data? (4000...5000).include?(code) end |
#missing_data? ⇒ Boolean
40 41 42 |
# File 'lib/itunes/store/transporter/errors.rb', line 40 def missing_data? (5000...6000).include?(code) end |
#schema_error? ⇒ Boolean
48 49 50 |
# File 'lib/itunes/store/transporter/errors.rb', line 48 def schema_error? (8000...9000).include?(code) end |
#to_s ⇒ Object
60 61 62 63 64 |
# File 'lib/itunes/store/transporter/errors.rb', line 60 def to_s s = .dup s << " (#{code})" if code s end |
#unsupported_feature? ⇒ Boolean
44 45 46 |
# File 'lib/itunes/store/transporter/errors.rb', line 44 def unsupported_feature? (6000...7000).include?(code) end |
#validation_error? ⇒ Boolean
56 57 58 |
# File 'lib/itunes/store/transporter/errors.rb', line 56 def validation_error? (3000...10_000).include?(code) end |