Class: Sidemash::Sdk::PublishRtmp
- Inherits:
-
Object
- Object
- Sidemash::Sdk::PublishRtmp
- Defined in:
- lib/sidemash/sdk/publish_rtmp.rb
Instance Attribute Summary collapse
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
-
#ip ⇒ Object
readonly
Returns the value of attribute ip.
-
#stream_key_prefix ⇒ Object
readonly
Returns the value of attribute stream_key_prefix.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(stream_key_prefix, ip, domain) ⇒ PublishRtmp
constructor
A new instance of PublishRtmp.
- #to_hash ⇒ Object
- #to_json(*a) ⇒ Object
- #to_remote ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(stream_key_prefix, ip, domain) ⇒ PublishRtmp
Returns a new instance of PublishRtmp.
26 27 28 29 30 31 |
# File 'lib/sidemash/sdk/publish_rtmp.rb', line 26 def initialize(stream_key_prefix, ip, domain) @_type = 'PublishRtmp' @stream_key_prefix = stream_key_prefix @ip = ip @domain = domain end |
Instance Attribute Details
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
24 25 26 |
# File 'lib/sidemash/sdk/publish_rtmp.rb', line 24 def domain @domain end |
#ip ⇒ Object (readonly)
Returns the value of attribute ip.
23 24 25 |
# File 'lib/sidemash/sdk/publish_rtmp.rb', line 23 def ip @ip end |
#stream_key_prefix ⇒ Object (readonly)
Returns the value of attribute stream_key_prefix.
22 23 24 |
# File 'lib/sidemash/sdk/publish_rtmp.rb', line 22 def stream_key_prefix @stream_key_prefix end |
Class Method Details
._type ⇒ Object
33 34 35 |
# File 'lib/sidemash/sdk/publish_rtmp.rb', line 33 def self._type 'PublishRtmp' end |
.from_hash(h) ⇒ Object
66 67 68 69 70 |
# File 'lib/sidemash/sdk/publish_rtmp.rb', line 66 def self.from_hash(h) PublishRtmp.new(h['stream_key_prefix'], SecureAndNonSecure.from_hash(h['ip']), SecureAndNonSecure.from_hash(h['domain'])) end |
.from_json(js) ⇒ Object
37 38 39 40 |
# File 'lib/sidemash/sdk/publish_rtmp.rb', line 37 def self.from_json(js) h = JSON.parse(js) PublishRtmp.from_hash(h) end |
.from_remote(h) ⇒ Object
60 61 62 63 64 |
# File 'lib/sidemash/sdk/publish_rtmp.rb', line 60 def self.from_remote(h) PublishRtmp.new(h['streamKeyPrefix'], SecureAndNonSecure.from_remote(h['ip']), SecureAndNonSecure.from_remote(h['domain'])) end |
Instance Method Details
#to_hash ⇒ Object
51 52 53 54 55 56 57 58 |
# File 'lib/sidemash/sdk/publish_rtmp.rb', line 51 def to_hash result = {} result[:_type] = @_type result[:stream_key_prefix] = @stream_key_prefix result[:ip] = @ip.to_hash result[:domain] = @domain.to_hash result end |
#to_json(*a) ⇒ Object
72 73 74 |
# File 'lib/sidemash/sdk/publish_rtmp.rb', line 72 def to_json(*a) to_hash.to_json(*a) end |
#to_remote ⇒ Object
42 43 44 45 46 47 48 49 |
# File 'lib/sidemash/sdk/publish_rtmp.rb', line 42 def to_remote result = {} result[:_type] = @_type result[:streamKeyPrefix] = @stream_key_prefix result[:ip] = @ip.to_remote result[:domain] = @domain.to_remote result end |
#to_s ⇒ Object
76 77 78 79 80 |
# File 'lib/sidemash/sdk/publish_rtmp.rb', line 76 def to_s ('PublishRtmp(stream_key_prefix=' + @stream_key_prefix + ', ip=' + @ip.to_s + ', domain=' + @domain.to_s + ')') end |