Class: WindowRails::Holder
- Inherits:
-
Object
- Object
- WindowRails::Holder
- Includes:
- Generators
- Defined in:
- lib/window_rails/holder.rb
Overview
Content container
Instance Attribute Summary collapse
-
#context ⇒ Context
Current context.
Instance Method Summary collapse
-
#<<(string) ⇒ self
Add string to buffer.
-
#initialize(args = {}) ⇒ Holder
constructor
Create new instance.
-
#window_flush ⇒ String
Clear current buffer and return content.
Methods included from Generators
#close_alert_window, #close_confirm_window, #close_window, #create_window, #open_alert_window, #open_confirm_window, #open_info_window, #open_window, #popover, #update_window
Constructor Details
#initialize(args = {}) ⇒ Holder
Create new instance
16 17 18 19 |
# File 'lib/window_rails/holder.rb', line 16 def initialize(args={}) @context = args[:context] @buffer = '' end |
Instance Attribute Details
#context ⇒ Context
Returns current context.
10 11 12 |
# File 'lib/window_rails/holder.rb', line 10 def context @context end |
Instance Method Details
#<<(string) ⇒ self
Add string to buffer
25 26 27 28 |
# File 'lib/window_rails/holder.rb', line 25 def << (string) @buffer << string.to_s self end |
#window_flush ⇒ String
Clear current buffer and return content
33 34 35 36 37 |
# File 'lib/window_rails/holder.rb', line 33 def window_flush buf = @buffer.dup @buffer = '' buf end |