Class: FastlyRails::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/fastly-rails/configuration.rb

Constant Summary collapse

MAX_AGE_DEFAULT =

30 days

'2592000'

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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_keyObject

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_ageObject

Returns the value of attribute max_age


6
7
8
# File 'lib/fastly-rails/configuration.rb', line 6

def max_age
  @max_age
end

#passwordObject

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

Parameters:

  • value

    the value to set the attribute purging_enabled to.


7
8
9
# File 'lib/fastly-rails/configuration.rb', line 7

def purging_enabled=(value)
  @purging_enabled = value
end

#service_idObject

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_errorObject

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_revalidateObject

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

#userObject

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_defaultObject


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

Returns:

  • (Boolean)

18
19
20
# File 'lib/fastly-rails/configuration.rb', line 18

def authenticatable?
  !!api_key
end

#invalid_service_id?Boolean

Returns:

  • (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

Returns:

  • (Boolean)

26
27
28
# File 'lib/fastly-rails/configuration.rb', line 26

def purging_enabled?
  @purging_enabled
end