Module: AttrFilters::Utils

Defined in:
lib/attr_filters/utils.rb

Class Method Summary collapse

Class Method Details

.extract_options(attrs) ⇒ Object



5
6
7
8
9
# File 'lib/attr_filters/utils.rb', line 5

def self.extract_options(attrs)
  last = attrs.last
  options = last.is_a?(::Hash) ? last : {}
  [attrs[0..-2], options]
end

.satisfied_spec?(spec_name) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/attr_filters/utils.rb', line 11

def self.satisfied_spec?(spec_name)
  Gem.loaded_specs.key?(spec_name)
end