Class: GoogleApiIndexV3Service
- Inherits:
-
ApplicationService
- Object
- ApplicationService
- GoogleApiIndexV3Service
- Defined in:
- app/services/google_api_index_v3_service.rb
Instance Attribute Summary collapse
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
-
#service ⇒ Object
Returns the value of attribute service.
Attributes inherited from ApplicationService
Instance Method Summary collapse
- #get_url_notification ⇒ Object
-
#initialize(domain) ⇒ GoogleApiIndexV3Service
constructor
A new instance of GoogleApiIndexV3Service.
Methods inherited from ApplicationService
Constructor Details
#initialize(domain) ⇒ GoogleApiIndexV3Service
Returns a new instance of GoogleApiIndexV3Service.
7 8 9 10 11 12 13 14 15 16 |
# File 'app/services/google_api_index_v3_service.rb', line 7 def initialize(domain) @domain = domain service = Google::Apis::IndexingV3::IndexingService.new = Google::Auth::ServiceAccountCredentials.make_creds( json_key_io: File.open('google_api_service_account_credentials.json'), scope: 'https://www.googleapis.com/auth/indexing' ) service. = @service = service end |
Instance Attribute Details
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
5 6 7 |
# File 'app/services/google_api_index_v3_service.rb', line 5 def domain @domain end |
#service ⇒ Object
Returns the value of attribute service.
4 5 6 |
# File 'app/services/google_api_index_v3_service.rb', line 4 def service @service end |
Instance Method Details
#get_url_notification ⇒ Object
18 19 20 |
# File 'app/services/google_api_index_v3_service.rb', line 18 def get_url_notification service.(url: domain.to_s) end |