Class: TransparentData::Actions::Search
- Inherits:
-
Object
- Object
- TransparentData::Actions::Search
- Defined in:
- lib/transparent_data/actions/search.rb
Constant Summary collapse
- COUNTRY_TO_KEY_MAP =
{ finland: :fi, czech: :cz, denmark: :dk, norway: :no, slovakia: :sk, uk: :uk }.freeze
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#country ⇒ Object
readonly
Returns the value of attribute country.
-
#query_str ⇒ Object
readonly
Returns the value of attribute query_str.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(client, country, query_str) ⇒ Search
constructor
A new instance of Search.
Constructor Details
#initialize(client, country, query_str) ⇒ Search
Returns a new instance of Search.
15 16 17 18 19 |
# File 'lib/transparent_data/actions/search.rb', line 15 def initialize(client, country, query_str) @client = client @country = country @query_str = query_str end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
13 14 15 |
# File 'lib/transparent_data/actions/search.rb', line 13 def client @client end |
#country ⇒ Object (readonly)
Returns the value of attribute country.
13 14 15 |
# File 'lib/transparent_data/actions/search.rb', line 13 def country @country end |
#query_str ⇒ Object (readonly)
Returns the value of attribute query_str.
13 14 15 |
# File 'lib/transparent_data/actions/search.rb', line 13 def query_str @query_str end |
Instance Method Details
#call ⇒ Object
21 22 23 24 25 |
# File 'lib/transparent_data/actions/search.rb', line 21 def call search_method = "#{fetch_country_id(country)}Search" TransparentData::Request.call(client, search_method, query: build_query(query_str)) end |