Sha256: 19ec3bd45628deb6b832c40b7b636cb76543a89812457417f54d21c9a8cfaadd

Contents?: true

Size: 365 Bytes

Versions: 10

Compression:

Stored size: 365 Bytes

Contents

require 'active_support/concern'

module Iord
  module Defaults
    extend ActiveSupport::Concern

    included do
      cattr_accessor :_iord_defaults, instance_accesssor: false do
        {}
      end
      self.singleton_class.send(:alias_method, :defaults, :_iord_defaults=)
    end

    def default(key)
      self.class._iord_defaults[key]
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
iord-1.2.2 lib/iord/defaults.rb
iord-1.2.1 lib/iord/defaults.rb
iord-1.2.0 lib/iord/defaults.rb
iord-1.1.3 lib/iord/defaults.rb
iord-1.1.2 lib/iord/defaults.rb
iord-1.1.1 lib/iord/defaults.rb
iord-1.1.0 lib/iord/defaults.rb
iord-1.0.3 lib/iord/defaults.rb
iord-1.0.2 lib/iord/defaults.rb
iord-1.0.1 lib/iord/defaults.rb