Class: EveOnline::ESI::Search
- Extended by:
- Forwardable
- Defined in:
- lib/eve_online/esi/search.rb
Constant Summary collapse
- API_PATH =
"/v2/search/"
- DEFAULT_CATEGORIES =
[ "agent", "alliance", "character", "constellation", "corporation", "faction", "inventory_type", "region", "solar_system", "station" ]
Constants inherited from Base
Instance Attribute Summary collapse
-
#categories ⇒ Object
readonly
Returns the value of attribute categories.
-
#raw_categories ⇒ Object
readonly
Returns the value of attribute raw_categories.
-
#search ⇒ Object
readonly
Returns the value of attribute search.
-
#strict ⇒ Object
readonly
Returns the value of attribute strict.
Attributes inherited from Base
#_open_timeout, #_read_timeout, #_write_timeout, #adapter, #language, #middlewares, #token
Instance Method Summary collapse
- #additional_query_params ⇒ Object
-
#initialize(options) ⇒ Search
constructor
A new instance of Search.
- #model ⇒ Object
- #path ⇒ Object
- #scope ⇒ Object
Methods inherited from Base
#add_middleware, #base_query_params, #connection, #error_limit_remain, #error_limit_reset, #http_method, #open_timeout, #open_timeout=, #page, #query, #read_timeout, #read_timeout=, #request_id, #resource, #response, #total_pages, #uri, #url, #user_agent, #write_timeout, #write_timeout=
Constructor Details
#initialize(options) ⇒ Search
Returns a new instance of Search.
27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/eve_online/esi/search.rb', line 27 def initialize() super @search = .fetch(:search) @strict = .fetch(:strict, false) @raw_categories = .fetch(:categories, DEFAULT_CATEGORIES) @raw_categories.each do |c| unless DEFAULT_CATEGORIES.include?(c) raise(ArgumentError) end end @categories = @raw_categories.join(",") end |
Instance Attribute Details
#categories ⇒ Object (readonly)
Returns the value of attribute categories.
25 26 27 |
# File 'lib/eve_online/esi/search.rb', line 25 def categories @categories end |
#raw_categories ⇒ Object (readonly)
Returns the value of attribute raw_categories.
25 26 27 |
# File 'lib/eve_online/esi/search.rb', line 25 def raw_categories @raw_categories end |
#search ⇒ Object (readonly)
Returns the value of attribute search.
25 26 27 |
# File 'lib/eve_online/esi/search.rb', line 25 def search @search end |
#strict ⇒ Object (readonly)
Returns the value of attribute strict.
25 26 27 |
# File 'lib/eve_online/esi/search.rb', line 25 def strict @strict end |
Instance Method Details
#additional_query_params ⇒ Object
52 53 54 |
# File 'lib/eve_online/esi/search.rb', line 52 def additional_query_params [:search, :categories, :strict] end |
#model ⇒ Object
45 46 47 |
# File 'lib/eve_online/esi/search.rb', line 45 def model @model ||= Models::Search.new(response) end |
#path ⇒ Object
56 57 58 |
# File 'lib/eve_online/esi/search.rb', line 56 def path format(API_PATH, search: search, categories: categories, strict: strict) end |
#scope ⇒ Object
49 50 |
# File 'lib/eve_online/esi/search.rb', line 49 def scope end |