Class: Mastodon::Media

Inherits:
Base
  • Object
show all
Defined in:
lib/mastodon/media.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#attributes

Instance Method Summary collapse

Methods inherited from Base

collection_attr_reader, define_attribute_method, define_predicate_method, normal_attr_reader, object_attr_reader, predicate_attr_reader

Constructor Details

#initialize(attributes = {}) ⇒ Media

Returns a new instance of Media.


29
30
31
32
# File 'lib/mastodon/media.rb', line 29

def initialize(attributes = {})
  attributes.fetch('id')
  super
end

Instance Attribute Details

#descriptionString (readonly)

Returns:

  • (String)

20
21
22
23
24
25
26
27
# File 'lib/mastodon/media.rb', line 20

normal_attr_reader :id,
:type,
:url,
:remote_url,
:preview_url,
:text_url,
:meta,
:description

#idString (readonly)

Returns:

  • (String)

20
21
22
23
24
25
26
27
# File 'lib/mastodon/media.rb', line 20

normal_attr_reader :id,
:type,
:url,
:remote_url,
:preview_url,
:text_url,
:meta,
:description

#metaHash (readonly)

Returns:

  • (Hash)

20
21
22
23
24
25
26
27
# File 'lib/mastodon/media.rb', line 20

normal_attr_reader :id,
:type,
:url,
:remote_url,
:preview_url,
:text_url,
:meta,
:description

#preview_urlString (readonly)

Returns URL to preview image.

Returns:

  • (String)

    URL to preview image


20
21
22
23
24
25
26
27
# File 'lib/mastodon/media.rb', line 20

normal_attr_reader :id,
:type,
:url,
:remote_url,
:preview_url,
:text_url,
:meta,
:description

#remote_urlString (readonly)

Returns:

  • (String)

20
21
22
23
24
25
26
27
# File 'lib/mastodon/media.rb', line 20

normal_attr_reader :id,
:type,
:url,
:remote_url,
:preview_url,
:text_url,
:meta,
:description

#text_urlString (readonly)

Returns URL that can be put into status body and will redirect to the status/media.

Returns:

  • (String)

    URL that can be put into status body and will redirect to the status/media


20
21
22
23
24
25
26
27
# File 'lib/mastodon/media.rb', line 20

normal_attr_reader :id,
:type,
:url,
:remote_url,
:preview_url,
:text_url,
:meta,
:description

#typeString (readonly)

Returns Image or video.

Returns:

  • (String)

    Image or video


20
21
22
23
24
25
26
27
# File 'lib/mastodon/media.rb', line 20

normal_attr_reader :id,
:type,
:url,
:remote_url,
:preview_url,
:text_url,
:meta,
:description

#urlString (readonly)

Returns Full file URL.

Returns:

  • (String)

    Full file URL


20
21
22
23
24
25
26
27
# File 'lib/mastodon/media.rb', line 20

normal_attr_reader :id,
:type,
:url,
:remote_url,
:preview_url,
:text_url,
:meta,
:description