Sha256: f3985ca88ed640762871d4e3a96a9cfe47e6a4d5ce0c3fb64a09b82d0fc7949f
Contents?: true
Size: 530 Bytes
Versions: 16
Compression:
Stored size: 530 Bytes
Contents
# When included, this module allows another module to be called setting a default preset # # Examples: # Maestrano::Settings.new # Uses 'default' preset # Maestrano['mypreset']::Settings.new # Uses 'mypreset' module Maestrano module Preset def self.included(base) base.extend ClassMethods end module ClassMethods def [](preset) define_singleton_method(:preset) { preset || 'default' } self end def preset 'default' end end end end
Version data entries
16 entries across 16 versions & 1 rubygems