Sha256: 2aa05366dd237cab064c7c9f08da768f94fe8cf72d7638f46676736fd6da3ee4

Contents?: true

Size: 472 Bytes

Versions: 4

Compression:

Stored size: 472 Bytes

Contents

module SearchConsoleApi
  module Resources
    module Sites
      class List
        def initialize(access_token:)
          @access_token = access_token
        end

        def call
          response["siteEntry"].each_with_object([]) do |attrs, sites|
            sites << Objects::Site.new(attrs)
          end
        end

        private

        def response
          Request.get(access_token: @access_token, path: "/sites")
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
search_console_api-0.0.4 lib/search_console_api/resources/sites/list.rb
search_console_api-0.0.3 lib/search_console_api/resources/sites/list.rb
search_console_api-0.0.2 lib/search_console_api/resources/sites/list.rb
search_console_api-0.0.1 lib/search_console_api/resources/sites/list.rb