Class: Sidemash::Sdk::Publish
- Inherits:
-
Object
- Object
- Sidemash::Sdk::Publish
- Defined in:
- lib/sidemash/sdk/publish.rb
Instance Attribute Summary collapse
-
#rtmp ⇒ Object
readonly
Returns the value of attribute rtmp.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(rtmp) ⇒ Publish
constructor
A new instance of Publish.
- #to_hash ⇒ Object
- #to_json(*a) ⇒ Object
- #to_remote ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(rtmp) ⇒ Publish
Returns a new instance of Publish.
24 25 26 27 |
# File 'lib/sidemash/sdk/publish.rb', line 24 def initialize(rtmp) @_type = 'Publish' @rtmp = rtmp end |
Instance Attribute Details
#rtmp ⇒ Object (readonly)
Returns the value of attribute rtmp.
22 23 24 |
# File 'lib/sidemash/sdk/publish.rb', line 22 def rtmp @rtmp end |
Class Method Details
._type ⇒ Object
29 30 31 |
# File 'lib/sidemash/sdk/publish.rb', line 29 def self._type 'Publish' end |
.from_hash(h) ⇒ Object
56 57 58 |
# File 'lib/sidemash/sdk/publish.rb', line 56 def self.from_hash(h) Publish.new(PublishRtmp.from_hash(h['rtmp'])) end |
.from_json(js) ⇒ Object
33 34 35 36 |
# File 'lib/sidemash/sdk/publish.rb', line 33 def self.from_json(js) h = JSON.parse(js) Publish.from_hash(h) end |
.from_remote(h) ⇒ Object
52 53 54 |
# File 'lib/sidemash/sdk/publish.rb', line 52 def self.from_remote(h) Publish.new(PublishRtmp.from_remote(h['rtmp'])) end |
Instance Method Details
#to_hash ⇒ Object
45 46 47 48 49 50 |
# File 'lib/sidemash/sdk/publish.rb', line 45 def to_hash result = {} result[:_type] = @_type result[:rtmp] = @rtmp.to_hash result end |
#to_json(*a) ⇒ Object
60 61 62 |
# File 'lib/sidemash/sdk/publish.rb', line 60 def to_json(*a) to_hash.to_json(*a) end |
#to_remote ⇒ Object
38 39 40 41 42 43 |
# File 'lib/sidemash/sdk/publish.rb', line 38 def to_remote result = {} result[:_type] = @_type result[:rtmp] = @rtmp.to_remote result end |
#to_s ⇒ Object
64 65 66 |
# File 'lib/sidemash/sdk/publish.rb', line 64 def to_s 'Publish(rtmp=' + @rtmp.to_s + ')' end |