Class: EveApp::Type

Inherits:
ApplicationRecord show all
Defined in:
app/models/eve_app/type.rb

Instance Method Summary collapse

Instance Method Details

#accessoire?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'app/models/eve_app/type.rb', line 13

def accessoire?
  category_id == EveApp::Category::ACCESSOIRE
end

#blueprint?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'app/models/eve_app/type.rb', line 9

def blueprint?
  category_id == EveApp::Category::BLUEPRINT
end

#descriptionObject



25
26
27
# File 'app/models/eve_app/type.rb', line 25

def description
  category.name
end

#image(size = 64) ⇒ Object



21
22
23
# File 'app/models/eve_app/type.rb', line 21

def image(size=64)
  "https://image.eveonline.com/Type/#{id}_#{size}.png"
end

#ship?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'app/models/eve_app/type.rb', line 17

def ship?
  category_id == EveApp::Category::SHIP
end

#sort_keyObject



29
30
31
# File 'app/models/eve_app/type.rb', line 29

def sort_key
  @_sort_key ||= [sort_index, name].join('-')
end