Class: Eve::Trust::IgbInterface

Inherits:
Object
  • Object
show all
Extended by:
ActiveSupport::Memoizable
Defined in:
lib/eve/trust/igb_interface.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request) ⇒ IgbInterface

Returns a new instance of IgbInterface.



8
9
10
# File 'lib/eve/trust/igb_interface.rb', line 8

def initialize(request)
  @request = request
end

Instance Attribute Details

#requestObject (readonly)

Returns the value of attribute request.



5
6
7
# File 'lib/eve/trust/igb_interface.rb', line 5

def request
  @request
end

Instance Method Details

#alliance_idObject



38
# File 'lib/eve/trust/igb_interface.rb', line 38

def alliance_id; igb_variable_get(:alliance_id); end

#alliance_nameObject



37
# File 'lib/eve/trust/igb_interface.rb', line 37

def alliance_name; igb_variable_get(:alliance_name); end

#char_idObject



34
# File 'lib/eve/trust/igb_interface.rb', line 34

def char_id; igb_variable_get(:char_id); end

#char_nameObject



33
# File 'lib/eve/trust/igb_interface.rb', line 33

def char_name; igb_variable_get(:char_name); end

#constellation_idObject

The IGB does not yet supply the proper headers for this method, so it will always return nil. However, if CCP implements it as written, this method should magically start working.



57
# File 'lib/eve/trust/igb_interface.rb', line 57

def constellation_id; igb_variable_get(:constellation_id, "The IGB does not yet supply :constellation_id headers, so this will always be nil"); end

#constellation_nameObject



40
# File 'lib/eve/trust/igb_interface.rb', line 40

def constellation_name; igb_variable_get(:constellation_name); end

#corp_idObject



36
# File 'lib/eve/trust/igb_interface.rb', line 36

def corp_id; igb_variable_get(:corp_id); end

#corp_nameObject



35
# File 'lib/eve/trust/igb_interface.rb', line 35

def corp_name; igb_variable_get(:corp_name); end

#corp_roleObject



41
# File 'lib/eve/trust/igb_interface.rb', line 41

def corp_role; igb_variable_get(:corp_role); end

#igb?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/eve/trust/igb_interface.rb', line 16

def igb?
  request.user_agent && (request.user_agent[/eve\-minibrowser/i] || request.user_agent[/EVE\-IGB/])
end

#militia_idObject

The IGB does not yet supply the proper headers for this method, so it will always return nil. However, if CCP implements it as written, this method should magically start working.



51
# File 'lib/eve/trust/igb_interface.rb', line 51

def militia_id; igb_variable_get(:militia_id, "The IGB does not yet supply :militia_id headers, so this will always be nil"); end

#militia_nameObject

The IGB does not yet supply the proper headers for this method, so it will always return nil. However, if CCP implements it as written, this method should magically start working.



48
# File 'lib/eve/trust/igb_interface.rb', line 48

def militia_name; igb_variable_get(:militia_name, "The IGB does not yet supply :militia_name headers, so this will always be nil"); end

#nearest_locationObject

Removed from Dominion, so always returns nil



69
70
71
72
# File 'lib/eve/trust/igb_interface.rb', line 69

def nearest_location
  igb_variable_get('nearest_location',
        "The nearest_location headers have been removed from the IGB as of Dominion, so this always returns nil.")
end

#region_idObject

The IGB does not yet supply the proper headers for this method, so it will always return nil. However, if CCP implements it as written, this method should magically start working.



54
# File 'lib/eve/trust/igb_interface.rb', line 54

def region_id; igb_variable_get(:region_id, "The IGB does not yet supply :region_id headers, so this will always be nil"); end

#region_nameObject



39
# File 'lib/eve/trust/igb_interface.rb', line 39

def region_name; igb_variable_get(:region_name); end

#server_ipObject



32
# File 'lib/eve/trust/igb_interface.rb', line 32

def server_ip; igb_variable_get(:server_ip); end

#ship_idObject

The IGB does not yet supply the proper headers for this method, so it will always return nil. However, if CCP implements it as written, this method should magically start working.



63
# File 'lib/eve/trust/igb_interface.rb', line 63

def ship_id; igb_variable_get(:ship_id, "The IGB does not yet supply :ship_id headers, so this will always be nil"); end

#solar_system_idObject

The IGB does not yet supply the proper headers for this method, so it will always return nil. However, if CCP implements it as written, this method should magically start working.



60
# File 'lib/eve/trust/igb_interface.rb', line 60

def solar_system_id; igb_variable_get(:solar_system_id, "The IGB does not yet supply :solar_system_id headers, so this will always be nil"); end

#solar_system_nameObject



44
# File 'lib/eve/trust/igb_interface.rb', line 44

def solar_system_name; igb_variable_get(:solar_system_name); end

#station_idObject



42
# File 'lib/eve/trust/igb_interface.rb', line 42

def station_id; igb_variable_get(:station_id); end

#station_nameObject



43
# File 'lib/eve/trust/igb_interface.rb', line 43

def station_name; igb_variable_get(:station_name); end

#system_securityObject

The IGB does not yet supply the proper headers for this method, so it will always return nil. However, if CCP implements it as written, this method should magically start working.



66
# File 'lib/eve/trust/igb_interface.rb', line 66

def system_security; igb_variable_get(:system_security, "The IGB does not yet supply :system_security headers, so this will always be nil"); end

#trustedObject



31
# File 'lib/eve/trust/igb_interface.rb', line 31

def trusted; igb_variable_get(:trusted); end

#trusted?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/eve/trust/igb_interface.rb', line 12

def trusted?
  trusted
end

#validation_stringObject

Validation string (HTTP_EVE_VALIDATION_STRING) is only a wishlist item, and is not actually implemented in the IGB yet. However, if CCP implements it as written, this method should magically start working.



22
23
24
25
26
27
28
29
# File 'lib/eve/trust/igb_interface.rb', line 22

def validation_string
return @validation_string if @validation_string
  @validation_string ||= request.headers['HTTP_EVE_VALIDATION_STRING'] || request.headers['HTTP_EVE_VALIDATIONSTRING']
  unless @validation_string
    warn "Validation string (HTTP_EVE_VALIDATION_STRING) is only a request, and is not implemented yet"
  end
  @validation_string
end