lib/bcx.rb in bcx-1.0.0 vs lib/bcx.rb in bcx-1.1.0

- old
+ new

@@ -27,15 +27,20 @@ module Launchpad autoload :OAuth, 'bcx/launchpad/oauth' end class << self - attr_accessor :configuration + attr_writer :configuration end + # Create configuration block in case the user does not call configure + def self.configuration + self.class.instance_variable_set('@configuration',Configuration.new) if self.class.instance_variable_get('@configuration').nil? + self.class.instance_variable_get('@configuration') + end + # Expose configuration block def self.configure - self.configuration ||= Configuration.new yield(configuration) end end # Use custom `Bcx::ResponseError` on top of Rapidash's error handling