Class: DeviceCloud::PushNotification::Message::FileData
- Inherits:
-
Object
- Object
- DeviceCloud::PushNotification::Message::FileData
- Defined in:
- lib/device_cloud/push_notification/message/file_data.rb
Instance Attribute Summary collapse
-
#cstId ⇒ Object
Returns the value of attribute cstId.
-
#fdArchive ⇒ Object
Returns the value of attribute fdArchive.
-
#fdContentType ⇒ Object
Returns the value of attribute fdContentType.
-
#fdCreatedDate ⇒ Object
Returns the value of attribute fdCreatedDate.
-
#fdData ⇒ Object
Returns the value of attribute fdData.
-
#fdLastModifiedDate ⇒ Object
Returns the value of attribute fdLastModifiedDate.
-
#fdSize ⇒ Object
Returns the value of attribute fdSize.
-
#fdType ⇒ Object
Returns the value of attribute fdType.
-
#id ⇒ Object
Returns the value of attribute id.
-
#no_content ⇒ Object
readonly
Returns the value of attribute no_content.
Instance Method Summary collapse
- #content? ⇒ Boolean
- #content_type ⇒ Object
- #data ⇒ Object
- #file_name ⇒ Object
- #file_path ⇒ Object
- #full_path ⇒ Object
-
#initialize(attributes = {}) ⇒ FileData
constructor
A new instance of FileData.
- #no_content? ⇒ Boolean
Constructor Details
#initialize(attributes = {}) ⇒ FileData
Returns a new instance of FileData.
9 10 11 12 13 14 15 |
# File 'lib/device_cloud/push_notification/message/file_data.rb', line 9 def initialize(attributes = {}) @no_content = false attributes.each do |name, value| send("#{name}=", value) end validate_content! end |
Instance Attribute Details
#cstId ⇒ Object
Returns the value of attribute cstId.
6 7 8 |
# File 'lib/device_cloud/push_notification/message/file_data.rb', line 6 def cstId @cstId end |
#fdArchive ⇒ Object
Returns the value of attribute fdArchive.
6 7 8 |
# File 'lib/device_cloud/push_notification/message/file_data.rb', line 6 def fdArchive @fdArchive end |
#fdContentType ⇒ Object
Returns the value of attribute fdContentType.
6 7 8 |
# File 'lib/device_cloud/push_notification/message/file_data.rb', line 6 def fdContentType @fdContentType end |
#fdCreatedDate ⇒ Object
Returns the value of attribute fdCreatedDate.
6 7 8 |
# File 'lib/device_cloud/push_notification/message/file_data.rb', line 6 def fdCreatedDate @fdCreatedDate end |
#fdData ⇒ Object
Returns the value of attribute fdData.
6 7 8 |
# File 'lib/device_cloud/push_notification/message/file_data.rb', line 6 def fdData @fdData end |
#fdLastModifiedDate ⇒ Object
Returns the value of attribute fdLastModifiedDate.
6 7 8 |
# File 'lib/device_cloud/push_notification/message/file_data.rb', line 6 def fdLastModifiedDate @fdLastModifiedDate end |
#fdSize ⇒ Object
Returns the value of attribute fdSize.
6 7 8 |
# File 'lib/device_cloud/push_notification/message/file_data.rb', line 6 def fdSize @fdSize end |
#fdType ⇒ Object
Returns the value of attribute fdType.
6 7 8 |
# File 'lib/device_cloud/push_notification/message/file_data.rb', line 6 def fdType @fdType end |
#id ⇒ Object
Returns the value of attribute id.
6 7 8 |
# File 'lib/device_cloud/push_notification/message/file_data.rb', line 6 def id @id end |
#no_content ⇒ Object (readonly)
Returns the value of attribute no_content.
7 8 9 |
# File 'lib/device_cloud/push_notification/message/file_data.rb', line 7 def no_content @no_content end |
Instance Method Details
#content? ⇒ Boolean
47 48 49 |
# File 'lib/device_cloud/push_notification/message/file_data.rb', line 47 def content? !no_content? end |
#content_type ⇒ Object
21 22 23 |
# File 'lib/device_cloud/push_notification/message/file_data.rb', line 21 def content_type fdContentType end |
#data ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/device_cloud/push_notification/message/file_data.rb', line 25 def data @data ||= if json_data? && content? JSON.parse unencoded_data else unencoded_data end end |
#file_name ⇒ Object
33 34 35 36 |
# File 'lib/device_cloud/push_notification/message/file_data.rb', line 33 def file_name return '' unless id && id['fdName'] id['fdName'] end |
#file_path ⇒ Object
38 39 40 41 |
# File 'lib/device_cloud/push_notification/message/file_data.rb', line 38 def file_path return '' unless id && id['fdPath'] id['fdPath'] end |
#full_path ⇒ Object
17 18 19 |
# File 'lib/device_cloud/push_notification/message/file_data.rb', line 17 def full_path file_path + file_name end |
#no_content? ⇒ Boolean
43 44 45 |
# File 'lib/device_cloud/push_notification/message/file_data.rb', line 43 def no_content? @no_content end |