Class: Shipeasy::Configuration
- Inherits:
-
Object
- Object
- Shipeasy::Configuration
- Defined in:
- lib/shipeasy/config.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
—- experimentation / SDK —-.
-
#attributes ⇒ Object
Optional transform from YOUR user object (any shape) to the Shipeasy attribute hash every flag/experiment evaluation uses.
-
#base_url ⇒ Object
—- experimentation / SDK —-.
-
#cdn_base_url ⇒ Object
—- i18n / string manager —-.
-
#default_chunk ⇒ Object
—- i18n / string manager —-.
-
#http_timeout ⇒ Object
—- i18n / string manager —-.
-
#label_file_cache_ttl ⇒ Object
—- i18n / string manager —-.
-
#loader_url ⇒ Object
—- i18n / string manager —-.
-
#manifest_cache_ttl ⇒ Object
—- i18n / string manager —-.
-
#profile ⇒ Object
—- i18n / string manager —-.
-
#public_key ⇒ Object
—- i18n / string manager —-.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/shipeasy/config.rb', line 42 def initialize @base_url = "https://edge.shipeasy.dev" @attributes = nil @profile = "default" @default_chunk = "index" @cdn_base_url = "https://cdn.i18n.shipeasy.ai" @loader_url = "https://cdn.i18n.shipeasy.ai/loader.js" @manifest_cache_ttl = 60 @label_file_cache_ttl = 3600 @http_timeout = 1 end |
Instance Attribute Details
#api_key ⇒ Object
—- experimentation / SDK —-
23 24 25 |
# File 'lib/shipeasy/config.rb', line 23 def api_key @api_key end |
#attributes ⇒ Object
Optional transform from YOUR user object (any shape) to the Shipeasy attribute hash every flag/experiment evaluation uses. A callable (lambda/proc or anything responding to #call). Default = identity (the user object is assumed to already BE the attribute hash). Runs once, in the Shipeasy::Client constructor.
Shipeasy.configure do |c|
c.api_key = ENV["SHIPEASY_SERVER_KEY"]
c.attributes = ->(u) { { "user_id" => u.id, "plan" => u.plan } }
end
35 36 37 |
# File 'lib/shipeasy/config.rb', line 35 def attributes @attributes end |
#base_url ⇒ Object
—- experimentation / SDK —-
23 24 25 |
# File 'lib/shipeasy/config.rb', line 23 def base_url @base_url end |
#cdn_base_url ⇒ Object
—- i18n / string manager —-
38 39 40 |
# File 'lib/shipeasy/config.rb', line 38 def cdn_base_url @cdn_base_url end |
#default_chunk ⇒ Object
—- i18n / string manager —-
38 39 40 |
# File 'lib/shipeasy/config.rb', line 38 def default_chunk @default_chunk end |
#http_timeout ⇒ Object
—- i18n / string manager —-
38 39 40 |
# File 'lib/shipeasy/config.rb', line 38 def http_timeout @http_timeout end |
#label_file_cache_ttl ⇒ Object
—- i18n / string manager —-
38 39 40 |
# File 'lib/shipeasy/config.rb', line 38 def label_file_cache_ttl @label_file_cache_ttl end |
#loader_url ⇒ Object
—- i18n / string manager —-
38 39 40 |
# File 'lib/shipeasy/config.rb', line 38 def loader_url @loader_url end |
#manifest_cache_ttl ⇒ Object
—- i18n / string manager —-
38 39 40 |
# File 'lib/shipeasy/config.rb', line 38 def manifest_cache_ttl @manifest_cache_ttl end |
#profile ⇒ Object
—- i18n / string manager —-
38 39 40 |
# File 'lib/shipeasy/config.rb', line 38 def profile @profile end |
#public_key ⇒ Object
—- i18n / string manager —-
38 39 40 |
# File 'lib/shipeasy/config.rb', line 38 def public_key @public_key end |