lib/learnosity/sdk/request/init.rb
# XXX: Needs to be public for unit tests
Needs to be public for unit tests
Needs to be public for unit tests
def add_meta
          if @request_packet.nil?
            @request_packet = {}
          end
          sdk_metrics = {
            :version => VERSION,
            :lang => 'ruby',
            :lang_version => RUBY_VERSION,
            :platform => get_platform,
            :platform_version => Sys::Uname.release
          }
          if @request_packet.include? 'meta'
            @request_packet['meta'].delete('sdk') if @request_packet['meta'].include? 'sdk'
            @request_packet['meta'][:sdk] = sdk_metrics
          elsif @request_packet.include? :meta
            @request_packet[:meta].delete('sdk') if @request_packet[:meta].include? 'sdk'
            @request_packet[:meta][:sdk] = sdk_metrics
          else
            @request_packet[:meta] = {}
            @request_packet[:meta][:sdk] = sdk_metrics
          end
        end
def add_meta if @request_packet . nil? @request_packet = { } end sdk_metrics = { :version => VERSION , :lang => 'ruby' , :lang_version => RUBY_VERSION , :platform => get_platform , :platform_version => Sys :: Uname . release } if @request_packet . include? 'meta' @request_packet [ 'meta' ] . delete ( 'sdk' ) if @request_packet [ 'meta' ] . include? 'sdk' @request_packet [ 'meta' ] [ :sdk ] = sdk_metrics elsif @request_packet . include? :meta @request_packet [ :meta ] . delete ( 'sdk' ) if @request_packet [ :meta ] . include? 'sdk' @request_packet [ :meta ] [ :sdk ] = sdk_metrics else @request_packet [ :meta ] = { } @request_packet [ :meta ] [ :sdk ] = sdk_metrics end end
XXX: Needs to be public for unit tests
XXX : Needs to be public for unit tests