Module: Emporium::Services::Options::ClassMethods

Defined in:
lib/emporium/services/options.rb

Instance Method Summary collapse

Instance Method Details

#configuration {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



10
11
12
13
# File 'lib/emporium/services/options.rb', line 10

def configuration
  yield self
  self
end

#service_attr_accessor(*attributes) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/emporium/services/options.rb', line 15

def service_attr_accessor(*attributes)
  attributes.each do |attribute|
    class_eval(<<-EOS)
      def self.#{attribute}
        @@#{attribute}
      end

      def self.#{attribute}=(value)
        @@#{attribute} = value
      end
    EOS
  end
end