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



138
139
140
# File 'lib/micro/attributes/features.rb', line 138

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

#with(names) ⇒ Object



142
143
144
145
146
147
148
# File 'lib/micro/attributes/features.rb', line 142

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



150
151
152
153
154
155
156
157
158
# File 'lib/micro/attributes/features.rb', line 150

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