Class: Helios::Sitemap::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/helios/sitemap/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



15
16
17
18
19
20
21
22
23
# File 'lib/helios/sitemap/configuration.rb', line 15

def initialize
  @s3_object_key = "sitemaps/sitemap.xml.gz"
  @aws_region = ENV["AWS_REGION"]
  @aws_bucket = ENV["AWS_SITEMAP_BUCKET"]
  @aws_access_key_id = ENV["AWS_ACCESS_KEY_ID"]
  @aws_secret_access_key = ENV["AWS_SECRET_ACCESS_KEY"]
  @indexnow_domain = ENV["INDEXNOW_DOMAIN"]
  @indexnow_api_key = ENV["INDEXNOW_API_KEY"]
end

Instance Attribute Details

#aws_access_key_idObject

Returns the value of attribute aws_access_key_id.



4
5
6
# File 'lib/helios/sitemap/configuration.rb', line 4

def aws_access_key_id
  @aws_access_key_id
end

#aws_bucketObject

Returns the value of attribute aws_bucket.



4
5
6
# File 'lib/helios/sitemap/configuration.rb', line 4

def aws_bucket
  @aws_bucket
end

#aws_regionObject

Returns the value of attribute aws_region.



4
5
6
# File 'lib/helios/sitemap/configuration.rb', line 4

def aws_region
  @aws_region
end

#aws_secret_access_keyObject

Returns the value of attribute aws_secret_access_key.



4
5
6
# File 'lib/helios/sitemap/configuration.rb', line 4

def aws_secret_access_key
  @aws_secret_access_key
end

#default_hostObject

Returns the value of attribute default_host.



4
5
6
# File 'lib/helios/sitemap/configuration.rb', line 4

def default_host
  @default_host
end

#indexnow_api_keyObject

Returns the value of attribute indexnow_api_key.



4
5
6
# File 'lib/helios/sitemap/configuration.rb', line 4

def indexnow_api_key
  @indexnow_api_key
end

#indexnow_domainObject

Returns the value of attribute indexnow_domain.



4
5
6
# File 'lib/helios/sitemap/configuration.rb', line 4

def indexnow_domain
  @indexnow_domain
end

#indexnow_urlsObject

Returns the value of attribute indexnow_urls.



4
5
6
# File 'lib/helios/sitemap/configuration.rb', line 4

def indexnow_urls
  @indexnow_urls
end

#s3_object_keyObject

Returns the value of attribute s3_object_key.



4
5
6
# File 'lib/helios/sitemap/configuration.rb', line 4

def s3_object_key
  @s3_object_key
end

#sitemap_entriesObject

Returns the value of attribute sitemap_entries.



4
5
6
# File 'lib/helios/sitemap/configuration.rb', line 4

def sitemap_entries
  @sitemap_entries
end

Instance Method Details

#s3_clientObject



25
26
27
28
29
30
# File 'lib/helios/sitemap/configuration.rb', line 25

def s3_client
  Aws::S3::Client.new(
    region: aws_region,
    credentials: Aws::Credentials.new(aws_access_key_id, aws_secret_access_key)
  )
end