Class: Xpost::Configuration
- Inherits:
-
Object
- Object
- Xpost::Configuration
- Defined in:
- lib/xpost/configuration.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#production_url ⇒ Object
Returns the value of attribute production_url.
-
#secret_key ⇒ Object
Returns the value of attribute secret_key.
-
#staging_url ⇒ Object
Returns the value of attribute staging_url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
5 6 7 8 9 10 |
# File 'lib/xpost/configuration.rb', line 5 def initialize @api_key @secret_key @staging_url @production_url end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
3 4 5 |
# File 'lib/xpost/configuration.rb', line 3 def api_key @api_key end |
#production_url ⇒ Object
Returns the value of attribute production_url.
3 4 5 |
# File 'lib/xpost/configuration.rb', line 3 def production_url @production_url end |
#secret_key ⇒ Object
Returns the value of attribute secret_key.
3 4 5 |
# File 'lib/xpost/configuration.rb', line 3 def secret_key @secret_key end |
#staging_url ⇒ Object
Returns the value of attribute staging_url.
3 4 5 |
# File 'lib/xpost/configuration.rb', line 3 def staging_url @staging_url end |
Class Method Details
.sample_configuration ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/xpost/configuration.rb', line 12 def self.sample_configuration api_key_line = File.readlines('.env').first.chomp secret_key_line = File.readlines('.env').last.chomp api_key = api_key_line.split('=').last secret_key = secret_key_line.split('=').last sample_configuration = Xpost.configure do |config| config.api_key = api_key config.secret_key = secret_key config.staging_url = "https://api.staging.lbcx.ph/v1" config.production_url = "https://api.staging.lbcx.ph/v1" end Xpost.configuration end |