Class: FastlyRails::Configuration
- Inherits:
-
Object
- Object
- FastlyRails::Configuration
- Defined in:
- lib/fastly-rails/configuration.rb
Constant Summary collapse
- MAX_AGE_DEFAULT =
30 days
'2592000'
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#max_age ⇒ Object
Returns the value of attribute max_age.
-
#password ⇒ Object
Returns the value of attribute password.
-
#purging_enabled ⇒ Object
writeonly
Sets the attribute purging_enabled.
-
#service_id ⇒ Object
Returns the value of attribute service_id.
-
#stale_if_error ⇒ Object
Returns the value of attribute stale_if_error.
-
#stale_while_revalidate ⇒ Object
Returns the value of attribute stale_while_revalidate.
-
#user ⇒ Object
Returns the value of attribute user.
Class Method Summary collapse
Instance Method Summary collapse
- #authenticatable? ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #invalid_service_id? ⇒ Boolean
- #purging_enabled? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
13 14 15 16 |
# File 'lib/fastly-rails/configuration.rb', line 13 def initialize @max_age = MAX_AGE_DEFAULT @purging_enabled = true end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
6 7 8 |
# File 'lib/fastly-rails/configuration.rb', line 6 def api_key @api_key end |
#max_age ⇒ Object
Returns the value of attribute max_age.
6 7 8 |
# File 'lib/fastly-rails/configuration.rb', line 6 def max_age @max_age end |
#password ⇒ Object
Returns the value of attribute password.
6 7 8 |
# File 'lib/fastly-rails/configuration.rb', line 6 def password @password end |
#purging_enabled=(value) ⇒ Object (writeonly)
Sets the attribute purging_enabled
7 8 9 |
# File 'lib/fastly-rails/configuration.rb', line 7 def purging_enabled=(value) @purging_enabled = value end |
#service_id ⇒ Object
Returns the value of attribute service_id.
6 7 8 |
# File 'lib/fastly-rails/configuration.rb', line 6 def service_id @service_id end |
#stale_if_error ⇒ Object
Returns the value of attribute stale_if_error.
6 7 8 |
# File 'lib/fastly-rails/configuration.rb', line 6 def stale_if_error @stale_if_error end |
#stale_while_revalidate ⇒ Object
Returns the value of attribute stale_while_revalidate.
6 7 8 |
# File 'lib/fastly-rails/configuration.rb', line 6 def stale_while_revalidate @stale_while_revalidate end |
#user ⇒ Object
Returns the value of attribute user.
6 7 8 |
# File 'lib/fastly-rails/configuration.rb', line 6 def user @user end |
Class Method Details
.max_age_default ⇒ Object
9 10 11 |
# File 'lib/fastly-rails/configuration.rb', line 9 def self.max_age_default MAX_AGE_DEFAULT end |
Instance Method Details
#authenticatable? ⇒ Boolean
18 19 20 |
# File 'lib/fastly-rails/configuration.rb', line 18 def authenticatable? !!api_key end |
#invalid_service_id? ⇒ Boolean
22 23 24 |
# File 'lib/fastly-rails/configuration.rb', line 22 def invalid_service_id? service_id_nil? || service_id_blank? end |
#purging_enabled? ⇒ Boolean
26 27 28 |
# File 'lib/fastly-rails/configuration.rb', line 26 def purging_enabled? @purging_enabled end |