Module: Fluent::Enclosers

Included in:
Fluent
Defined in:
lib/fluent/enclosers.rb

Instance Method Summary collapse

Instance Method Details

#will_alert(&block) ⇒ String

Provides a context for an action that will generate a JavaScript alert message box. The alert invocation will be overridden by the platform.

Parameters:

  • block (Proc)

    the code that generates the alert

Returns:

  • (String)

    the message contained in the alert message box



9
10
11
# File 'lib/fluent/enclosers.rb', line 9

def will_alert(&block)
  platform.will_alert(&block)
end

#will_confirm(response, &block) ⇒ String

Provides a context for an action that will generate a JavaScript confirmation message box. The confirmation invocation will be overridden by the platform.

Parameters:

  • response (Boolean)

    true to accept the confirmation, false to cancel it

  • block (Proc)

    the code that generates the confirmation

Returns:

  • (String)

    the message contained in the confirmation message box



20
21
22
# File 'lib/fluent/enclosers.rb', line 20

def will_confirm(response, &block)
  platform.will_confirm(response, &block)
end

#will_prompt(response, &block) ⇒ Hash

Provides a context for an action that will generate a JavaScript prompt message box. The prompt invocation will be overridden by the platform.

the value that the prompt had before the response was applied

Parameters:

  • response (String)

    the value to be used in the prompt

  • block (Proc)

    the code that generates the prompt

Returns:

  • (Hash)

    :message for the prompt message, :default_value for



31
32
33
# File 'lib/fluent/enclosers.rb', line 31

def will_prompt(response, &block)
  platform.will_prompt(response, &block)
end