Class: EveApp::Type
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- EveApp::Type
- Defined in:
- app/models/eve_app/type.rb
Instance Method Summary collapse
- #accessoire? ⇒ Boolean
- #blueprint? ⇒ Boolean
- #description ⇒ Object
- #image(size = 64) ⇒ Object
- #ship? ⇒ Boolean
- #sort_key ⇒ Object
Instance Method Details
#accessoire? ⇒ Boolean
13 14 15 |
# File 'app/models/eve_app/type.rb', line 13 def accessoire? category_id == EveApp::Category::ACCESSOIRE end |
#blueprint? ⇒ Boolean
9 10 11 |
# File 'app/models/eve_app/type.rb', line 9 def blueprint? category_id == EveApp::Category::BLUEPRINT end |
#description ⇒ Object
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
17 18 19 |
# File 'app/models/eve_app/type.rb', line 17 def ship? category_id == EveApp::Category::SHIP end |
#sort_key ⇒ Object
29 30 31 |
# File 'app/models/eve_app/type.rb', line 29 def sort_key @_sort_key ||= [sort_index, name].join('-') end |