Class: PDUTools::MessagePart
- Inherits:
-
Object
- Object
- PDUTools::MessagePart
- Defined in:
- lib/pdu_tools/message_part.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#body ⇒ Object
Returns the value of attribute body.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#user_data_header ⇒ Object
readonly
Returns the value of attribute user_data_header.
-
#validity_period ⇒ Object
readonly
Returns the value of attribute validity_period.
Instance Method Summary collapse
- #complete? ⇒ Boolean
-
#initialize(address, body, timestamp, validity_period, user_data_header) ⇒ MessagePart
constructor
A new instance of MessagePart.
Constructor Details
#initialize(address, body, timestamp, validity_period, user_data_header) ⇒ MessagePart
Returns a new instance of MessagePart.
7 8 9 10 11 12 13 |
# File 'lib/pdu_tools/message_part.rb', line 7 def initialize address, body, , validity_period, user_data_header @address = address @body = body @timestamp = @validity_period = validity_period @user_data_header = user_data_header end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
3 4 5 |
# File 'lib/pdu_tools/message_part.rb', line 3 def address @address end |
#body ⇒ Object
Returns the value of attribute body.
3 4 5 |
# File 'lib/pdu_tools/message_part.rb', line 3 def body @body end |
#metadata ⇒ Object
Returns the value of attribute metadata.
5 6 7 |
# File 'lib/pdu_tools/message_part.rb', line 5 def @metadata end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
3 4 5 |
# File 'lib/pdu_tools/message_part.rb', line 3 def @timestamp end |
#user_data_header ⇒ Object (readonly)
Returns the value of attribute user_data_header.
3 4 5 |
# File 'lib/pdu_tools/message_part.rb', line 3 def user_data_header @user_data_header end |
#validity_period ⇒ Object (readonly)
Returns the value of attribute validity_period.
3 4 5 |
# File 'lib/pdu_tools/message_part.rb', line 3 def validity_period @validity_period end |
Instance Method Details
#complete? ⇒ Boolean
15 16 17 18 19 20 21 22 23 |
# File 'lib/pdu_tools/message_part.rb', line 15 def complete? return true unless @user_data_header return true unless @user_data_header[:multipart] if @user_data_header[:multipart][:parts] > 1 false else true end end |