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.
-
#platforms ⇒ Object
Returns the value of attribute platforms.
-
#scheduled_at ⇒ Object
Returns the value of attribute scheduled_at.
-
#status ⇒ Object
Returns the value of attribute status.
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.
90 91 92 93 94 95 96 97 98 99 |
# File 'lib/postproxy/types.rb', line 90 def initialize(**attrs) @scheduled_at = nil @platforms = [] super @scheduled_at = parse_time(@scheduled_at) @created_at = parse_time(@created_at) @platforms = (@platforms || []).map do |p| p.is_a?(PlatformResult) ? p : PlatformResult.new(**p.transform_keys(&:to_sym)) end end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
88 89 90 |
# File 'lib/postproxy/types.rb', line 88 def body @body end |
#created_at ⇒ Object
Returns the value of attribute created_at.
88 89 90 |
# File 'lib/postproxy/types.rb', line 88 def created_at @created_at end |
#id ⇒ Object
Returns the value of attribute id.
88 89 90 |
# File 'lib/postproxy/types.rb', line 88 def id @id end |
#platforms ⇒ Object
Returns the value of attribute platforms.
88 89 90 |
# File 'lib/postproxy/types.rb', line 88 def platforms @platforms end |
#scheduled_at ⇒ Object
Returns the value of attribute scheduled_at.
88 89 90 |
# File 'lib/postproxy/types.rb', line 88 def scheduled_at @scheduled_at end |
#status ⇒ Object
Returns the value of attribute status.
88 89 90 |
# File 'lib/postproxy/types.rb', line 88 def status @status end |