Class: RMQTextChange

Inherits:
Android::Telephony::PhoneNumberFormattingTextWatcher
  • Object
show all
Defined in:
lib/project/ruby_motion_query/rmq/event_wrappers/rmq_text_change.rb

Overview

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(action = :after, &block) ⇒ RMQTextChange

Returns a new instance of RMQTextChange.

[View source]

7
8
9
10
# File 'lib/project/ruby_motion_query/rmq/event_wrappers/rmq_text_change.rb', line 7

def initialize(action=:after, &block)
  @action = action
  @change_block = block
end

Instance Attribute Details

#change_blockObject

Returns the value of attribute change_block.


5
6
7
# File 'lib/project/ruby_motion_query/rmq/event_wrappers/rmq_text_change.rb', line 5

def change_block
  @change_block
end

Instance Method Details

#afterTextChanged(s) ⇒ Object

[View source]

20
21
22
# File 'lib/project/ruby_motion_query/rmq/event_wrappers/rmq_text_change.rb', line 20

def afterTextChanged(s)
  @change_block.call(s) if @action == :after
end

#beforeTextChanged(s, start, count, after) ⇒ Object

[View source]

16
17
18
# File 'lib/project/ruby_motion_query/rmq/event_wrappers/rmq_text_change.rb', line 16

def beforeTextChanged(s, start, count, after)
  @change_block.call(s, start, count, after) if @action == :before
end

#onTextChanged(s, start, before, count) ⇒ Object

[View source]

12
13
14
# File 'lib/project/ruby_motion_query/rmq/event_wrappers/rmq_text_change.rb', line 12

def onTextChanged(s, start, before, count)
  @change_block.call(s, start, before, count) if @action == :on
end