Class: Nelumba::Audio
Constant Summary
Constants included from Object
Object::USERNAME_REGULAR_EXPRESSION
Instance Attribute Summary collapse
-
#embed_code ⇒ Object
readonly
A fragment of HTML markup that, when embedded within another HTML page, provides an interactive user-interface for viewing or listening to the audio stream.
-
#stream ⇒ Object
readonly
A MediaLink to the audio content itself.
Attributes included from Object
#author, #content, #display_name, #html, #image, #published, #summary, #text, #title, #uid, #updated, #url
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Audio
constructor
Creates a new Audio activity object.
-
#to_hash ⇒ Object
Returns a hash of all relevant fields.
-
#to_json_hash ⇒ Object
Returns a hash of all relevant fields with JSON activity streams conventions.
Methods included from Object
#init, #mentions, #reply_to, #to_as1, #to_html, #to_json, #to_text
Constructor Details
#initialize(options = {}) ⇒ Audio
Creates a new Audio activity object.
14 15 16 17 18 19 |
# File 'lib/nelumba/audio.rb', line 14 def initialize( = {}) super @embed_code = [:embed_code] @stream = [:stream] end |
Instance Attribute Details
#embed_code ⇒ Object (readonly)
A fragment of HTML markup that, when embedded within another HTML page, provides an interactive user-interface for viewing or listening to the audio stream.
8 9 10 |
# File 'lib/nelumba/audio.rb', line 8 def @embed_code end |
#stream ⇒ Object (readonly)
A MediaLink to the audio content itself.
11 12 13 |
# File 'lib/nelumba/audio.rb', line 11 def stream @stream end |
Instance Method Details
#to_hash ⇒ Object
Returns a hash of all relevant fields.
22 23 24 25 26 27 |
# File 'lib/nelumba/audio.rb', line 22 def to_hash { :embed_code => @embed_code, :stream => @stream }.merge(super) end |
#to_json_hash ⇒ Object
Returns a hash of all relevant fields with JSON activity streams conventions.
31 32 33 34 35 36 37 |
# File 'lib/nelumba/audio.rb', line 31 def to_json_hash { :objectType => "audio", :embedCode => @embed_code, :stream => @stream }.merge(super) end |