Class: Restforce::Configuration::Option
- Inherits:
-
Object
- Object
- Restforce::Configuration::Option
- Defined in:
- lib/restforce/config.rb
Instance Attribute Summary collapse
-
#configuration ⇒ Object
readonly
Returns the value of attribute configuration.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
- #define ⇒ Object
-
#initialize(configuration, name, options = {}) ⇒ Option
constructor
A new instance of Option.
Constructor Details
#initialize(configuration, name, options = {}) ⇒ Option
Returns a new instance of Option.
50 51 52 53 54 55 |
# File 'lib/restforce/config.rb', line 50 def initialize(configuration, name, = {}) @configuration = configuration @name = name @options = @default = .fetch(:default, nil) end |
Instance Attribute Details
#configuration ⇒ Object (readonly)
Returns the value of attribute configuration.
44 45 46 |
# File 'lib/restforce/config.rb', line 44 def configuration @configuration end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
44 45 46 |
# File 'lib/restforce/config.rb', line 44 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
44 45 46 |
# File 'lib/restforce/config.rb', line 44 def @options end |
Class Method Details
.define(*args) ⇒ Object
46 47 48 |
# File 'lib/restforce/config.rb', line 46 def self.define(*args) new(*args).define end |
Instance Method Details
#define ⇒ Object
57 58 59 60 61 |
# File 'lib/restforce/config.rb', line 57 def define write_attribute define_method if default_provided? self end |