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.



115
116
117
118
119
120
121
# File 'lib/postproxy/types.rb', line 115

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.



113
114
115
# File 'lib/postproxy/types.rb', line 113

def body
  @body
end

#idObject

Returns the value of attribute id.



113
114
115
# File 'lib/postproxy/types.rb', line 113

def id
  @id
end

#mediaObject

Returns the value of attribute media.



113
114
115
# File 'lib/postproxy/types.rb', line 113

def media
  @media
end