Class: SafeDb::Paste

Inherits:
EditVerse show all
Defined in:
lib/controller/edit/paste.rb

Overview

Paste the current clipboard or selection text into the specified line at the current book’s open chapter and verse.

Sensitive values now neither need to be put on the commnad line (safe put) or inputted perhaps with a typo when using (safe input).

Use safe wipe to wipe (overwrite) any sensitive values that has been placed on the clipboard.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from EditVerse

#execute

Methods inherited from Controller

#check_post_conditions, #check_pre_conditions, #execute, #flow, #initialize, #open_remote_backend_location, #post_validation, #pre_validation, #read_verse, #set_verse, #update_verse

Constructor Details

This class inherits a constructor from SafeDb::Controller

Instance Attribute Details

#line=(value) ⇒ Object (writeonly)

this entity can point to a book, chapter, verse or line. If no parameter entity is provided, the –all switch must be present to avoid an error message.



18
19
20
# File 'lib/controller/edit/paste.rb', line 18

def line=(value)
  @line = value
end

Instance Method Details

#edit_verseObject

The paste use case places a string from the clipboard into the specified line (@password is the default if no line name is specified).



22
23
24
25
26
27
28
29
30
# File 'lib/controller/edit/paste.rb', line 22

def edit_verse()

  @line = "@password" if @line.nil?
  @verse.store( "#{@line}-#{TimeStamp.yyjjj_hhmm_sst()}", @verse[ @line ] ) if @verse.has_key?( @line )

  clipboard_text = Clipboard.read_line()
  @verse.store( @line, clipboard_text )

end