Class: Dramaturg::Value::Masked

Inherits:
Base
  • Object
show all
Defined in:
lib/dramaturg/value/masked.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#for_debug_prompt, #for_run

Constructor Details

#initialize(value) ⇒ Masked

Returns a new instance of Masked.



7
8
9
10
# File 'lib/dramaturg/value/masked.rb', line 7

def initialize(value)
  @display = '$SECRET'
  super(value)
end

Instance Attribute Details

#display=(value) ⇒ Object (writeonly)

Sets the attribute display

Parameters:

  • value

    the value to set the attribute display to.



5
6
7
# File 'lib/dramaturg/value/masked.rb', line 5

def display=(value)
  @display = value
end

Instance Method Details

#for_promptObject



12
13
14
# File 'lib/dramaturg/value/masked.rb', line 12

def for_prompt
  @display
end

#inspectObject



20
21
22
# File 'lib/dramaturg/value/masked.rb', line 20

def inspect
  "{#@display = #@value}"
end

#to_sObject



16
17
18
# File 'lib/dramaturg/value/masked.rb', line 16

def to_s
  "{#@display}"
end