Class: Tinysky::ExternalEmbed

Inherits:
Object
  • Object
show all
Defined in:
lib/tinysky/external_embed.rb

Instance Method Summary collapse

Constructor Details

#initialize(attrs) ⇒ ExternalEmbed

Returns a new instance of ExternalEmbed.



3
4
5
6
7
8
# File 'lib/tinysky/external_embed.rb', line 3

def initialize(attrs)
  @description = attrs[:description]
  @thumb = attrs[:thumb]
  @title = attrs[:title]
  @uri = attrs[:uri]
end

Instance Method Details

#to_hashObject



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/tinysky/external_embed.rb', line 10

def to_hash
  {
    "$type" => Tinysky::Lexicon::EXTERNAL_EMBED,
    "external" => {
      "description" => @description,
      "thumb" => @thumb,
      "title" => @title,
      "uri" => @uri
    }
  }
end