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.
24 25 26 27 |
# File 'lib/itunes/store/transporter/errors.rb', line 24 def initialize(, code = nil) @message = @code = code end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
21 22 23 |
# File 'lib/itunes/store/transporter/errors.rb', line 21 def code @code end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
22 23 24 |
# File 'lib/itunes/store/transporter/errors.rb', line 22 def @message end |
Instance Method Details
#asset_error? ⇒ Boolean
51 52 53 |
# File 'lib/itunes/store/transporter/errors.rb', line 51 def asset_error? (9000...10_000).include?(code) end |
#bad_data? ⇒ Boolean
1000…2000?
31 32 33 |
# File 'lib/itunes/store/transporter/errors.rb', line 31 def bad_data? (3000...4000).include?(code) end |
#invalid_data? ⇒ Boolean
35 36 37 |
# File 'lib/itunes/store/transporter/errors.rb', line 35 def invalid_data? (4000...5000).include?(code) end |
#missing_data? ⇒ Boolean
39 40 41 |
# File 'lib/itunes/store/transporter/errors.rb', line 39 def missing_data? (5000...6000).include?(code) end |
#schema_error? ⇒ Boolean
47 48 49 |
# File 'lib/itunes/store/transporter/errors.rb', line 47 def schema_error? (8000...9000).include?(code) end |
#to_s ⇒ Object
59 60 61 62 63 |
# File 'lib/itunes/store/transporter/errors.rb', line 59 def to_s s = .dup s << " (#{code})" if code s end |
#unsupported_feature? ⇒ Boolean
43 44 45 |
# File 'lib/itunes/store/transporter/errors.rb', line 43 def unsupported_feature? (6000...7000).include?(code) end |
#validation_error? ⇒ Boolean
55 56 57 |
# File 'lib/itunes/store/transporter/errors.rb', line 55 def validation_error? (3000...10_000).include?(code) end |