Class: Controll::Notify::Flash

Inherits:
Object
  • Object
show all
Defined in:
lib/controll/notify/flash.rb

Direct Known Subclasses

Base, Typed

Class Attribute Summary collapse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(controller, options = {}) ⇒ Flash

Returns a new instance of Flash.



6
7
8
9
# File 'lib/controll/notify/flash.rb', line 6

def initialize controller, options = {}
  @controller = controller
  @options = options if options.kind_of? Hash
end

Class Attribute Details

.typesObject



22
23
24
# File 'lib/controll/notify/flash.rb', line 22

def types
  @types ||= Controll::Event.valid_types
end

Instance Attribute Details

#controllerObject (readonly)

Returns the value of attribute controller.



4
5
6
# File 'lib/controll/notify/flash.rb', line 4

def controller
  @controller
end

Class Method Details

.add_types(*types) ⇒ Object Also known as: add_type



26
27
28
# File 'lib/controll/notify/flash.rb', line 26

def add_types *types
  @types += types if types.all? {|type| type.kind_of? Symbol}
end