Class: Greeve::Application

Inherits:
Object
  • Object
show all
Defined in:
lib/greeve/application.rb

Overview

Information about the application Greeve is being used in. This info is used to generate a custom user-agent as recommended by CCP so that the application can be identified.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeApplication

Returns a new instance of Application

Raises:

  • (TypeError)

    cannot instantiate a singleton



22
23
24
# File 'lib/greeve/application.rb', line 22

def initialize
  raise TypeError, "Cannot instantiate a singleton"
end

Class Method Details

.user_agentString

Returns Application's HTTP user-agent

Returns:

  • (String)

    Application's HTTP user-agent



9
10
11
# File 'lib/greeve/application.rb', line 9

def self.user_agent
  @user_agent ||= "Unspecified".freeze
end

.user_agent=(user_agent) ⇒ Object

Parameters:

  • user_agent (String)

    Application's HTTP user-agent



14
15
16
17
18
19
# File 'lib/greeve/application.rb', line 14

def self.user_agent=(user_agent)
  @user_agent = user_agent
  Typhoeus::Config.user_agent = Greeve::BaseItem.user_agent

  @user_agent
end