Sha256: 4f3ca7167960ba62d5d1fbfe6b74cf1875278f256dbeec49cb4986800a17ffb5
Contents?: true
Size: 831 Bytes
Versions: 1
Compression:
Stored size: 831 Bytes
Contents
# frozen_string_literal: true require "micro/attributes/features/diff" require "micro/attributes/features/initialize" module Micro module Attributes module Features module InitializeAndDiff def self.included(base) base.send(:include, ::Micro::Attributes::Features::Initialize) base.send(:include, ::Micro::Attributes::Features::Diff) end end OPTIONS = { 'diff' => Diff, 'initialize' => Initialize, 'diff:initialize' => InitializeAndDiff }.freeze private_constant :OPTIONS def self.fetch(names) option = OPTIONS[names.map { |name| name.to_s.downcase }.sort.join(':')] return option if option raise ArgumentError, 'Invalid feature name! Available options: diff, initialize' end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
u-attributes-0.10.0 | lib/micro/attributes/features.rb |