Class: Messaging::Adapters::Test::Categories

Inherits:
Object
  • Object
show all
Defined in:
lib/messaging/adapters/test/categories.rb

Instance Method Summary collapse

Constructor Details

#initializeCategories

Returns a new instance of Categories.



5
6
7
# File 'lib/messaging/adapters/test/categories.rb', line 5

def initialize
  clear!
end

Instance Method Details

#[](name) ⇒ Object



9
10
11
# File 'lib/messaging/adapters/test/categories.rb', line 9

def [](name)
  @categories[name]
end

#clear!Object



13
14
15
# File 'lib/messaging/adapters/test/categories.rb', line 13

def clear!
  @categories = Hash.new { |h, k| h[k] = Category.new(k) }
end