Class: PostProxy::Media

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

Returns a new instance of Media.



115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/postproxy/types.rb', line 115

def initialize(**attrs)
  @error_message = nil
  @source_url = nil
  @url = nil
  @platforms = nil
  super
  if @platforms.is_a?(Array)
    @platforms = @platforms.map do |p|
      p.is_a?(MediaPlatformError) ? p : MediaPlatformError.new(**p.transform_keys(&:to_sym))
    end
  end
end

Instance Attribute Details

#content_typeObject

Returns the value of attribute content_type.



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

def content_type
  @content_type
end

#error_messageObject

Returns the value of attribute error_message.



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

def error_message
  @error_message
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#platformsObject

Returns the value of attribute platforms.



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

def platforms
  @platforms
end

#source_urlObject

Returns the value of attribute source_url.



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

def source_url
  @source_url
end

#statusObject

Returns the value of attribute status.



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

def status
  @status
end

#urlObject

Returns the value of attribute url.



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

def url
  @url
end