Class: Punk::Tool::Opts

Inherits:
Object
  • Object
show all
Defined in:
lib/cryptopunks/tool.rb

Overview

use nested Opts class (inside Tool) - why? why not?

Instance Method Summary collapse

Instance Method Details

#fileObject



16
# File 'lib/cryptopunks/tool.rb', line 16

def file()    @file || './punks.png';  end

#file=(file) ⇒ Object



18
# File 'lib/cryptopunks/tool.rb', line 18

def file=(file) @file = file; end

#file?Boolean

note: let’s you check if file is set (or “untouched”)

Returns:

  • (Boolean)


17
# File 'lib/cryptopunks/tool.rb', line 17

def file?()   @file;  end

#offsetObject



24
# File 'lib/cryptopunks/tool.rb', line 24

def offset()  @offset || 0; end

#offset=(num) ⇒ Object



26
# File 'lib/cryptopunks/tool.rb', line 26

def offset=(num) @offset = num; end

#offset?Boolean

Returns:

  • (Boolean)


25
# File 'lib/cryptopunks/tool.rb', line 25

def offset?() @offset;  end

#outdirObject



28
# File 'lib/cryptopunks/tool.rb', line 28

def outdir()  @outdir || '.'; end

#outdir=(dir) ⇒ Object



30
# File 'lib/cryptopunks/tool.rb', line 30

def outdir=(dir) @outdir = dir;  end

#outdir?Boolean

Returns:

  • (Boolean)


29
# File 'lib/cryptopunks/tool.rb', line 29

def outdir?() @outdir;  end

#seedObject

use a standard (default) seed - why? why not?



33
# File 'lib/cryptopunks/tool.rb', line 33

def seed()  @seed || 4142; end

#seed=(num) ⇒ Object



35
# File 'lib/cryptopunks/tool.rb', line 35

def seed=(num) @seed = num; end

#seed?Boolean

Returns:

  • (Boolean)


34
# File 'lib/cryptopunks/tool.rb', line 34

def seed?() @seed;  end

#verbose=(boolean) ⇒ Object

add: alias for debug ??



7
8
9
# File 'lib/cryptopunks/tool.rb', line 7

def verbose=(boolean)   # add: alias for debug ??
  @verbose = boolean
end

#verbose?Boolean

Returns:

  • (Boolean)


11
12
13
14
# File 'lib/cryptopunks/tool.rb', line 11

def verbose?
  return false if @verbose.nil?   # default verbose/debug flag is false
  @verbose == true
end

#zoomObject



20
# File 'lib/cryptopunks/tool.rb', line 20

def zoom()    @zoom || 1; end

#zoom=(num) ⇒ Object



22
# File 'lib/cryptopunks/tool.rb', line 22

def zoom=(num) @zoom = num; end

#zoom?Boolean

Returns:

  • (Boolean)


21
# File 'lib/cryptopunks/tool.rb', line 21

def zoom?()   @zoom;  end