Module: Micro::Attributes::Features

Extended by:
Features
Included in:
Features
Defined in:
lib/micro/attributes/features.rb,
lib/micro/attributes/features/diff.rb,
lib/micro/attributes/features/accept.rb,
lib/micro/attributes/features/initialize.rb,
lib/micro/attributes/features/accept/strict.rb,
lib/micro/attributes/features/keys_as_symbol.rb,
lib/micro/attributes/features/initialize/strict.rb,
lib/micro/attributes/features/activemodel_validations.rb

Defined Under Namespace

Modules: Accept, ActiveModelValidations, Diff, Initialize, KeysAsSymbol, Options

Instance Method Summary collapse

Instance Method Details

#allObject



205
206
207
# File 'lib/micro/attributes/features.rb', line 205

def all
  @all ||= self.with(Options::KEYS)
end

#with(names) ⇒ Object



209
210
211
212
213
214
215
# File 'lib/micro/attributes/features.rb', line 209

def with(names)
  Options.fetch_keys(names) do |keys|
    Options.remove_base_if_has_strict(keys)

    Options.fetch_module_by_keys(keys)
  end
end

#without(names) ⇒ Object



217
218
219
220
221
222
223
224
225
# File 'lib/micro/attributes/features.rb', line 217

def without(names)
  Options.fetch_keys(names) do |keys|
    keys_to_fetch = Options.without_keys(keys)

    return ::Micro::Attributes if keys_to_fetch.empty?

    Options.fetch_module_by_keys(keys_to_fetch)
  end
end