Class: Punk::Opts

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

Instance Method Summary collapse

Instance Method Details

#fileObject



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

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

#file?Boolean

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

Returns:

  • (Boolean)


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

def file?()   @file;  end

#merge_gli_options!(options = {}) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/cryptopunks/tool.rb', line 14

def merge_gli_options!( options = {} )
  # puts "  update options:"
  # puts options.inspect

  @file     = options[:file]      if options[:file]
  @outdir   = options[:dir]       if options[:dir]

  @zoom     = options[:zoom]      if options[:zoom]
  @offset   = options[:offset]    if options[:offset]

  @seed     = options[:seed]      if options[:seed]

  @verbose = true     if options[:verbose] == true
end

#offsetObject



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

def offset()  @offset || 0; end

#offset?Boolean

Returns:

  • (Boolean)


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

def offset?() @offset;  end

#outdirObject



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

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

#outdir?Boolean

Returns:

  • (Boolean)


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

def outdir?() @outdir;  end

#seedObject

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



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

def seed()  @seed || 4142; end

#seed?Boolean

Returns:

  • (Boolean)


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

def seed?() @seed;  end

#verbose=(boolean) ⇒ Object

add: alias for debug ??



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

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

#verbose?Boolean

Returns:

  • (Boolean)


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

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

#zoomObject



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

def zoom()    @zoom || 1; end

#zoom?Boolean

Returns:

  • (Boolean)


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

def zoom?()   @zoom;  end