Class: SearchConsoleApi::Client
- Inherits:
-
Object
- Object
- SearchConsoleApi::Client
- Defined in:
- lib/search_console_api/client.rb
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
Instance Method Summary collapse
-
#initialize(access_token) ⇒ Client
constructor
A new instance of Client.
- #query(site:, start_date:, end_date:, dimensions: [], type: nil, dimension_filter_groups: [], aggregation_type: nil, row_limit: nil, start_row: nil, data_state: nil) ⇒ Object
- #sites ⇒ Object
Constructor Details
#initialize(access_token) ⇒ Client
Returns a new instance of Client.
8 9 10 |
# File 'lib/search_console_api/client.rb', line 8 def initialize(access_token) @access_token = access_token end |
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
6 7 8 |
# File 'lib/search_console_api/client.rb', line 6 def access_token @access_token end |
Instance Method Details
#query(site:, start_date:, end_date:, dimensions: [], type: nil, dimension_filter_groups: [], aggregation_type: nil, row_limit: nil, start_row: nil, data_state: nil) ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/search_console_api/client.rb', line 16 def query(site:, start_date:, end_date:, dimensions: [], type: nil, dimension_filter_groups: [], aggregation_type: nil, row_limit: nil, start_row: nil, data_state: nil) Resources::SearchAnalytics::Query.new( access_token: @access_token, site: site, start_date: start_date, end_date: end_date, dimensions: dimensions, type: type, dimension_filter_groups: dimension_filter_groups, aggregation_type: aggregation_type, row_limit: row_limit, start_row: start_row, data_state: data_state ).call end |
#sites ⇒ Object
12 13 14 |
# File 'lib/search_console_api/client.rb', line 12 def sites @sites ||= Resources::Sites::List.new(access_token: @access_token).call end |