Class: SafeDb::Print

Inherits:
QueryVerse show all
Defined in:
lib/controller/query/print.rb

Overview

The print use case prints out a credential value without a line feed or any other contextual information.

Print is perfect for reading values from scripts or using unix like pipe behaviour to pass credentials to other commands.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from QueryVerse

#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

#key_name=(value) ⇒ Object (writeonly)

Sets the attribute key_name

Parameters:

  • value

    the value to set the attribute key_name to.



12
13
14
# File 'lib/controller/query/print.rb', line 12

def key_name=(value)
  @key_name = value
end

Instance Method Details

#query_verseObject

Use the chapter and verse setup to read the parameter @key_name and print its corresponding value without a line feed or return.



16
17
18
19
20
# File 'lib/controller/query/print.rb', line 16

def query_verse()

  print @verse[ @key_name ]

end