Class: PostProxy::ThreadChild

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) ⇒ ThreadChild

Returns a new instance of ThreadChild.



101
102
103
104
105
106
107
# File 'lib/postproxy/types.rb', line 101

def initialize(**attrs)
  @media = []
  super
  @media = (@media || []).map do |m|
    m.is_a?(Media) ? m : Media.new(**m.transform_keys(&:to_sym))
  end
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



99
100
101
# File 'lib/postproxy/types.rb', line 99

def body
  @body
end

#idObject

Returns the value of attribute id.



99
100
101
# File 'lib/postproxy/types.rb', line 99

def id
  @id
end

#mediaObject

Returns the value of attribute media.



99
100
101
# File 'lib/postproxy/types.rb', line 99

def media
  @media
end