Class: PusherPlatform::SDKInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/pusher-platform/sdk_info.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ SDKInfo

Returns a new instance of SDKInfo.

Raises:



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/pusher-platform/sdk_info.rb', line 7

def initialize(options)
  raise Error.new('No product_name provided to SDKInfo') if options[:product_name].nil?
  raise Error.new('No version provided to SDKInfo') if options[:version].nil?

  @product_name = options[:product_name]
  @version = options[:version]

  @platform = options[:platform] || 'server'
  @language = 'ruby'

  @headers = {
    "X-SDK-Product" => @product_name,
    "X-SDK-Version" => @version,
    "X-SDK-Language" => @language,
    "X-SDK-Platform" => @platform
  }
end

Instance Attribute Details

#headersObject (readonly)

Returns the value of attribute headers.



5
6
7
# File 'lib/pusher-platform/sdk_info.rb', line 5

def headers
  @headers
end

#languageObject (readonly)

Returns the value of attribute language.



5
6
7
# File 'lib/pusher-platform/sdk_info.rb', line 5

def language
  @language
end

#platformObject (readonly)

Returns the value of attribute platform.



5
6
7
# File 'lib/pusher-platform/sdk_info.rb', line 5

def platform
  @platform
end

#product_nameObject (readonly)

Returns the value of attribute product_name.



5
6
7
# File 'lib/pusher-platform/sdk_info.rb', line 5

def product_name
  @product_name
end

#versionObject (readonly)

Returns the value of attribute version.



5
6
7
# File 'lib/pusher-platform/sdk_info.rb', line 5

def version
  @version
end