Class: PostProxy::Post
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#id ⇒ Object
Returns the value of attribute id.
-
#media ⇒ Object
Returns the value of attribute media.
-
#platforms ⇒ Object
Returns the value of attribute platforms.
-
#queue_id ⇒ Object
Returns the value of attribute queue_id.
-
#queue_priority ⇒ Object
Returns the value of attribute queue_priority.
-
#scheduled_at ⇒ Object
Returns the value of attribute scheduled_at.
-
#status ⇒ Object
Returns the value of attribute status.
-
#thread ⇒ Object
Returns the value of attribute thread.
Instance Method Summary collapse
-
#initialize(**attrs) ⇒ Post
constructor
A new instance of Post.
Methods inherited from Model
Constructor Details
#initialize(**attrs) ⇒ Post
Returns a new instance of Post.
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
# File 'lib/postproxy/types.rb', line 137 def initialize(**attrs) @scheduled_at = nil @media = [] @platforms = [] @thread = [] @queue_id = nil @queue_priority = nil super @scheduled_at = parse_time(@scheduled_at) @created_at = parse_time(@created_at) @media = (@media || []).map do |m| m.is_a?(Media) ? m : Media.new(**m.transform_keys(&:to_sym)) end @platforms = (@platforms || []).map do |p| p.is_a?(PlatformResult) ? p : PlatformResult.new(**p.transform_keys(&:to_sym)) end @thread = (@thread || []).map do |t| t.is_a?(ThreadChild) ? t : ThreadChild.new(**t.transform_keys(&:to_sym)) end end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
134 135 136 |
# File 'lib/postproxy/types.rb', line 134 def body @body end |
#created_at ⇒ Object
Returns the value of attribute created_at.
134 135 136 |
# File 'lib/postproxy/types.rb', line 134 def created_at @created_at end |
#id ⇒ Object
Returns the value of attribute id.
134 135 136 |
# File 'lib/postproxy/types.rb', line 134 def id @id end |
#media ⇒ Object
Returns the value of attribute media.
134 135 136 |
# File 'lib/postproxy/types.rb', line 134 def media @media end |
#platforms ⇒ Object
Returns the value of attribute platforms.
134 135 136 |
# File 'lib/postproxy/types.rb', line 134 def platforms @platforms end |
#queue_id ⇒ Object
Returns the value of attribute queue_id.
134 135 136 |
# File 'lib/postproxy/types.rb', line 134 def queue_id @queue_id end |
#queue_priority ⇒ Object
Returns the value of attribute queue_priority.
134 135 136 |
# File 'lib/postproxy/types.rb', line 134 def queue_priority @queue_priority end |
#scheduled_at ⇒ Object
Returns the value of attribute scheduled_at.
134 135 136 |
# File 'lib/postproxy/types.rb', line 134 def scheduled_at @scheduled_at end |
#status ⇒ Object
Returns the value of attribute status.
134 135 136 |
# File 'lib/postproxy/types.rb', line 134 def status @status end |
#thread ⇒ Object
Returns the value of attribute thread.
134 135 136 |
# File 'lib/postproxy/types.rb', line 134 def thread @thread end |