Class: RespondForHelper::Behaviour
- Inherits:
-
Object
- Object
- RespondForHelper::Behaviour
- Defined in:
- lib/respond_for_helper/behaviour.rb
Constant Summary collapse
- TYPES =
[:render, :redirect, :head]
Instance Attribute Summary collapse
-
#flash ⇒ Object
Returns the value of attribute flash.
-
#flash_message ⇒ Object
Returns the value of attribute flash_message.
-
#options ⇒ Object
Returns the value of attribute options.
-
#target ⇒ Object
Returns the value of attribute target.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #flash? ⇒ Boolean
- #head? ⇒ Boolean
-
#initialize(attrs) ⇒ Behaviour
constructor
A new instance of Behaviour.
- #redirect? ⇒ Boolean
- #render? ⇒ Boolean
Constructor Details
#initialize(attrs) ⇒ Behaviour
Returns a new instance of Behaviour.
9 10 11 12 13 14 15 |
# File 'lib/respond_for_helper/behaviour.rb', line 9 def initialize(attrs) @type = attrs.delete(:type) @target = attrs.delete(:target) @flash = attrs.delete(:flash) @flash_message = attrs.delete(:flash_message) @options = attrs end |
Instance Attribute Details
#flash ⇒ Object
Returns the value of attribute flash.
7 8 9 |
# File 'lib/respond_for_helper/behaviour.rb', line 7 def flash @flash end |
#flash_message ⇒ Object
Returns the value of attribute flash_message.
7 8 9 |
# File 'lib/respond_for_helper/behaviour.rb', line 7 def @flash_message end |
#options ⇒ Object
Returns the value of attribute options.
7 8 9 |
# File 'lib/respond_for_helper/behaviour.rb', line 7 def @options end |
#target ⇒ Object
Returns the value of attribute target.
7 8 9 |
# File 'lib/respond_for_helper/behaviour.rb', line 7 def target @target end |
#type ⇒ Object
Returns the value of attribute type.
7 8 9 |
# File 'lib/respond_for_helper/behaviour.rb', line 7 def type @type end |
Instance Method Details
#flash? ⇒ Boolean
29 30 31 |
# File 'lib/respond_for_helper/behaviour.rb', line 29 def flash? @flash end |
#head? ⇒ Boolean
25 26 27 |
# File 'lib/respond_for_helper/behaviour.rb', line 25 def head? @type == :head end |
#redirect? ⇒ Boolean
21 22 23 |
# File 'lib/respond_for_helper/behaviour.rb', line 21 def redirect? @type == :redirect end |
#render? ⇒ Boolean
17 18 19 |
# File 'lib/respond_for_helper/behaviour.rb', line 17 def render? @type == :render end |