Module: Redistat::Options

Included in:
Event, Key, Label, Model
Defined in:
lib/redistat/mixins/options.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



4
5
6
# File 'lib/redistat/mixins/options.rb', line 4

def self.included(base)
  base.extend(ClassMethods)
end

Instance Method Details

#default_optionsObject



28
29
30
# File 'lib/redistat/mixins/options.rb', line 28

def default_options
  {}
end

#optionsObject



32
33
34
# File 'lib/redistat/mixins/options.rb', line 32

def options
  @options ||= {}
end

#parse_options(opts) ⇒ Object



22
23
24
25
26
# File 'lib/redistat/mixins/options.rb', line 22

def parse_options(opts)
  opts ||= {}
  @raw_options = opts
  @options = default_options.merge(opts.reject { |k,v| v.nil? })
end

#raw_optionsObject



36
37
38
# File 'lib/redistat/mixins/options.rb', line 36

def raw_options
  @raw_options ||= {}
end