Class: WindowRails::Holder

Inherits:
Object
  • Object
show all
Includes:
Generators
Defined in:
lib/window_rails/holder.rb

Overview

Content container

Instance Attribute Summary collapse

Instance Method Summary collapse

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

Parameters:

  • args (Hash) (defaults to: {})

Options Hash (args):

  • :context (Context)


16
17
18
19
# File 'lib/window_rails/holder.rb', line 16

def initialize(args={})
  @context = args[:context]
  @buffer = ''
end

Instance Attribute Details

#contextContext

Returns current context.

Returns:

  • (Context)

    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

Parameters:

  • string (String)

Returns:

  • (self)


25
26
27
28
# File 'lib/window_rails/holder.rb', line 25

def << (string)
  @buffer << string.to_s
  self
end

#window_flushString

Clear current buffer and return content

Returns:

  • (String)


33
34
35
36
37
# File 'lib/window_rails/holder.rb', line 33

def window_flush
  buf = @buffer.dup
  @buffer = ''
  buf
end