Module: Brainstem::Concerns::Optional

Instance Method Summary collapse

Instance Method Details

#initialize(options = {}) ⇒ Object



37
38
39
# File 'lib/brainstem/concerns/optional.rb', line 37

def initialize(options = {})
  options.slice(*valid_options).each {|k, v| self.send("#{k}=", v) }
end

#valid_optionsArray<Symbol>

The options that should be extracted and sent to the class on initialization.

Returns:

  • (Array<Symbol>)

    valid options



33
34
35
# File 'lib/brainstem/concerns/optional.rb', line 33

def valid_options
  [ ]
end