Class: SearchConsoleApi::Objects::QueryResponseRow

Inherits:
Object
  • Object
show all
Defined in:
lib/search_console_api/objects/query_response_row.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}, dimensions = []) ⇒ QueryResponseRow

Returns a new instance of QueryResponseRow.



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/search_console_api/objects/query_response_row.rb', line 7

def initialize(attributes = {}, dimensions = [])
  @keys = attributes["keys"]
  @clicks = attributes["clicks"]
  @impressions = attributes["impressions"]
  @ctr = attributes["ctr"]
  @position = attributes["position"]

  dimensions.each_with_index do |dimension, index|
    instance_variable_set("@#{dimension}", @keys[index])
  end
end

Instance Attribute Details

#clicksObject

Returns the value of attribute clicks.



4
5
6
# File 'lib/search_console_api/objects/query_response_row.rb', line 4

def clicks
  @clicks
end

#countryObject

Returns the value of attribute country.



4
5
6
# File 'lib/search_console_api/objects/query_response_row.rb', line 4

def country
  @country
end

#ctrObject

Returns the value of attribute ctr.



4
5
6
# File 'lib/search_console_api/objects/query_response_row.rb', line 4

def ctr
  @ctr
end

#dateObject

Returns the value of attribute date.



4
5
6
# File 'lib/search_console_api/objects/query_response_row.rb', line 4

def date
  @date
end

#deviceObject

Returns the value of attribute device.



4
5
6
# File 'lib/search_console_api/objects/query_response_row.rb', line 4

def device
  @device
end

#impressionsObject

Returns the value of attribute impressions.



4
5
6
# File 'lib/search_console_api/objects/query_response_row.rb', line 4

def impressions
  @impressions
end

#keysObject

Returns the value of attribute keys.



4
5
6
# File 'lib/search_console_api/objects/query_response_row.rb', line 4

def keys
  @keys
end

#pageObject

Returns the value of attribute page.



4
5
6
# File 'lib/search_console_api/objects/query_response_row.rb', line 4

def page
  @page
end

#positionObject

Returns the value of attribute position.



4
5
6
# File 'lib/search_console_api/objects/query_response_row.rb', line 4

def position
  @position
end

#queryObject

Returns the value of attribute query.



4
5
6
# File 'lib/search_console_api/objects/query_response_row.rb', line 4

def query
  @query
end

#search_appearanceObject

Returns the value of attribute search_appearance.



4
5
6
# File 'lib/search_console_api/objects/query_response_row.rb', line 4

def search_appearance
  @search_appearance
end