Class: Restforce::Configuration::Option

Inherits:
Object
  • Object
show all
Defined in:
lib/restforce/config.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(configuration, name, options = {}) ⇒ Option

Returns a new instance of Option.



49
50
51
52
53
54
# File 'lib/restforce/config.rb', line 49

def initialize(configuration, name, options = {})
  @configuration = configuration
  @name = name
  @options = options
  @default = options.fetch(:default, nil)
end

Instance Attribute Details

#configurationObject (readonly)

Returns the value of attribute configuration.



43
44
45
# File 'lib/restforce/config.rb', line 43

def configuration
  @configuration
end

#nameObject (readonly)

Returns the value of attribute name.



43
44
45
# File 'lib/restforce/config.rb', line 43

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



43
44
45
# File 'lib/restforce/config.rb', line 43

def options
  @options
end

Class Method Details

.define(*args) ⇒ Object



45
46
47
# File 'lib/restforce/config.rb', line 45

def self.define(*args)
  new(*args).define
end

Instance Method Details

#defineObject



56
57
58
59
60
# File 'lib/restforce/config.rb', line 56

def define
  write_attribute
  define_method if default_provided?
  self
end