Class: RubyCurses::InputDataEvent

Inherits:
Object
  • Object
show all
Defined in:
lib/rbcurse/rinputdataevent.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(index0, index1, source, type, row, text) ⇒ InputDataEvent

Returns a new instance of InputDataEvent.



23
24
25
26
27
28
29
30
# File 'lib/rbcurse/rinputdataevent.rb', line 23

def initialize index0, index1, source, type, row, text
  @index0 = index0
  @index1 = index1
  @source = source
  @type = type
  @row = row
  @text = text
end

Instance Attribute Details

#index0Object

Returns the value of attribute index0.



22
23
24
# File 'lib/rbcurse/rinputdataevent.rb', line 22

def index0
  @index0
end

#index1Object

Returns the value of attribute index1.



22
23
24
# File 'lib/rbcurse/rinputdataevent.rb', line 22

def index1
  @index1
end

#rowObject

Returns the value of attribute row.



22
23
24
# File 'lib/rbcurse/rinputdataevent.rb', line 22

def row
  @row
end

#sourceObject

Returns the value of attribute source.



22
23
24
# File 'lib/rbcurse/rinputdataevent.rb', line 22

def source
  @source
end

#textObject

Returns the value of attribute text.



22
23
24
# File 'lib/rbcurse/rinputdataevent.rb', line 22

def text
  @text
end

#typeObject

Returns the value of attribute type.



22
23
24
# File 'lib/rbcurse/rinputdataevent.rb', line 22

def type
  @type
end

Instance Method Details

#getvalueObject

this is so that earlier applications were getting source in the block, not an event. they were doing a fld.getvalue, so we must keep those apps running

Since:

  • 1.2.0 added 2010-09-11 12:25



44
45
46
# File 'lib/rbcurse/rinputdataevent.rb', line 44

def getvalue
  @source.getvalue
end

#inspectObject



36
37
38
39
40
# File 'lib/rbcurse/rinputdataevent.rb', line 36

def inspect
  ## now that textarea.to_s prints content we shouldn pass it here.
  #"#{@type.to_s}, #{@source}, ind0:#{@index0}, ind1:#{@index1}, row:#{@row}, text:#{@text}"
  "#{@type.to_s}, ind0:#{@index0}, ind1:#{@index1}, row:#{@row}, text:#{@text}"
end

#to_sObject

until now to_s was returning inspect, but to make it easy for users let us return the value they most expect which is the text that was changed



33
34
35
# File 'lib/rbcurse/rinputdataevent.rb', line 33

def to_s
  inspect
end