Class: Pdfh::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/pdfh/utils/options.rb

Overview

Argument Options object container

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arg_options) ⇒ self

Parameters:

  • arg_options (Hash)


10
11
12
13
14
15
16
# File 'lib/pdfh/utils/options.rb', line 10

def initialize(arg_options)
  @verbose = arg_options[:verbose]
  @dry = arg_options[:dry]
  @type = arg_options[:type]
  @files = arg_options[:files] || []
  @mode = type ? :file : :directory
end

Instance Attribute Details

#filesObject (readonly)

Returns the value of attribute files.



6
7
8
# File 'lib/pdfh/utils/options.rb', line 6

def files
  @files
end

#typeObject (readonly)

Returns the value of attribute type.



6
7
8
# File 'lib/pdfh/utils/options.rb', line 6

def type
  @type
end

Instance Method Details

#dry?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/pdfh/utils/options.rb', line 24

def dry?
  @dry
end

#file_mode?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/pdfh/utils/options.rb', line 29

def file_mode?
  @mode == :file
end

#files?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/pdfh/utils/options.rb', line 34

def files?
  !!@files&.any?
end

#verbose?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/pdfh/utils/options.rb', line 19

def verbose?
  @verbose
end