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.



32
33
34
35
# File 'lib/mastodon/media.rb', line 32

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

Instance Attribute Details

#descriptionString (readonly)

Returns:

  • (String)


23
24
25
26
27
28
29
30
# File 'lib/mastodon/media.rb', line 23

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

#idString (readonly)

Returns:

  • (String)


23
24
25
26
27
28
29
30
# File 'lib/mastodon/media.rb', line 23

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

#metaHash (readonly)

Returns:

  • (Hash)


23
24
25
26
27
28
29
30
# File 'lib/mastodon/media.rb', line 23

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



23
24
25
26
27
28
29
30
# File 'lib/mastodon/media.rb', line 23

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

#remote_urlString (readonly)

Returns:

  • (String)


23
24
25
26
27
28
29
30
# File 'lib/mastodon/media.rb', line 23

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



23
24
25
26
27
28
29
30
# File 'lib/mastodon/media.rb', line 23

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



23
24
25
26
27
28
29
30
# File 'lib/mastodon/media.rb', line 23

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



23
24
25
26
27
28
29
30
# File 'lib/mastodon/media.rb', line 23

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