Class: Eve::Trust::IgbInterface

Inherits:
Object
  • Object
show all
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.



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

def initialize(request)
  @request = request
end

Instance Attribute Details

#requestObject (readonly)

Returns the value of attribute request.



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

def request
  @request
end

Instance Method Details

#alliance_idObject



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

def alliance_id; igb_variable_get(:alliance_id); end

#alliance_nameObject



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

def alliance_name; igb_variable_get(:alliance_name); end

#char_idObject



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

def char_id; igb_variable_get(:char_id); end

#char_nameObject



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

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.



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

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



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

def constellation_name; igb_variable_get(:constellation_name); end

#corp_idObject



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

def corp_id; igb_variable_get(:corp_id); end

#corp_nameObject



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

def corp_name; igb_variable_get(:corp_name); end

#corp_roleObject



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

def corp_role; igb_variable_get(:corp_role); end

#igb?Boolean

Returns:

  • (Boolean)


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

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.



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

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.



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

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



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

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.



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

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



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

def region_name; igb_variable_get(:region_name); end

#server_ipObject



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

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.



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

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.



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

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



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

def solar_system_name; igb_variable_get(:solar_system_name); end

#station_idObject



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

def station_id; igb_variable_get(:station_id); end

#station_nameObject



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

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.



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

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



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

def trusted; igb_variable_get(:trusted); end

#trusted?Boolean

Returns:

  • (Boolean)


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

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.



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

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