Module: Messaging::Category::Macro

Defined in:
lib/messaging/category.rb

Instance Method Summary collapse

Instance Method Details

#category_macro(category) ⇒ Object Also known as: category



12
13
14
15
16
17
18
19
20
21
# File 'lib/messaging/category.rb', line 12

def category_macro(category)
  category = Category.normalize(category)
  self.send :define_method, :category do
    @category ||= category
  end

  self.send :define_method, :category= do |category|
    @category = category
  end
end