Class: PostProxy::Post

Inherits:
Model
  • Object
show all
Defined in:
lib/postproxy/types.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Model

#to_h

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

#bodyObject

Returns the value of attribute body.



88
89
90
# File 'lib/postproxy/types.rb', line 88

def body
  @body
end

#created_atObject

Returns the value of attribute created_at.



88
89
90
# File 'lib/postproxy/types.rb', line 88

def created_at
  @created_at
end

#idObject

Returns the value of attribute id.



88
89
90
# File 'lib/postproxy/types.rb', line 88

def id
  @id
end

#platformsObject

Returns the value of attribute platforms.



88
89
90
# File 'lib/postproxy/types.rb', line 88

def platforms
  @platforms
end

#scheduled_atObject

Returns the value of attribute scheduled_at.



88
89
90
# File 'lib/postproxy/types.rb', line 88

def scheduled_at
  @scheduled_at
end

#statusObject

Returns the value of attribute status.



88
89
90
# File 'lib/postproxy/types.rb', line 88

def status
  @status
end