lib/opentok/session.rb in opentok-2.2.4 vs lib/opentok/session.rb in opentok-2.3.0

- old
+ new

@@ -15,15 +15,18 @@ # or to :relayed if the session attempts to transmit streams directly between clients. # # @attr_reader [String] location The location hint IP address. See the OpenTok.createSession() # method. # + # @attr_reader [String] archive_mode Whether the session will be archived automatically + # (<code>:always</code>) or not (<code>:manual</code>). + # # @!method generate_token(options) # Generates a token. # # @param [Hash] options - # @option options [String] :role The role for the token. Set this to one of the following + # @option options [Symbol] :role The role for the token. Set this to one of the following # values: # * <code>:subscriber</code> -- A subscriber can only subscribe to streams. # # * <code>:publisher</code> -- A publisher can publish streams, subscribe to # streams, and signal. (This is the default value if you do not specify a role.) @@ -47,11 +50,11 @@ :api_key => ->(instance) { instance.api_key }, :api_secret => ->(instance) { instance.api_secret }, :session_id => ->(instance) { instance.session_id } }) - attr_reader :session_id, :media_mode, :location, :api_key, :api_secret + attr_reader :session_id, :media_mode, :location, :archive_mode, :api_key, :api_secret # @private # this implementation doesn't completely understand the format of a Session ID # that is intentional, that is too much responsibility. def self.belongs_to_api_key?(session_id, api_key) @@ -63,10 +66,10 @@ end # @private def initialize(api_key, api_secret, session_id, opts={}) @api_key, @api_secret, @session_id = api_key, api_secret, session_id - @media_mode, @location = opts.fetch(:media_mode, :relayed), opts[:location] + @media_mode, @location, @archive_mode = opts.fetch(:media_mode, :relayed), opts[:location], opts.fetch(:archive_mode, :manual) end # @private def to_s @session_id