Class: HasOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/conan/has_options.rb

Direct Known Subclasses

Deployment

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ HasOptions

Returns a new instance of HasOptions.



4
5
6
# File 'lib/conan/has_options.rb', line 4

def initialize(options)
  @options = options
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



2
3
4
# File 'lib/conan/has_options.rb', line 2

def options
  @options
end

Instance Method Details

#option(key, value) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/conan/has_options.rb', line 8

def option(key, value)
  if @options[key].nil?
    @options[key] = [value]
  else
    @options[key] << value
  end
end