Class: Pdfh::Options
- Inherits:
-
Object
- Object
- Pdfh::Options
- Defined in:
- lib/pdfh/utils/options.rb
Overview
Argument Options object container
Instance Attribute Summary collapse
-
#files ⇒ Object
readonly
Returns the value of attribute files.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #dry? ⇒ Boolean
- #file_mode? ⇒ Boolean
- #files? ⇒ Boolean
- #initialize(arg_options) ⇒ self constructor
- #verbose? ⇒ Boolean
Constructor Details
#initialize(arg_options) ⇒ self
10 11 12 13 14 15 16 |
# File 'lib/pdfh/utils/options.rb', line 10 def initialize() @verbose = [:verbose] @dry = [:dry] @type = [:type] @files = [:files] || [] @mode = type ? :file : :directory end |
Instance Attribute Details
#files ⇒ Object (readonly)
Returns the value of attribute files.
6 7 8 |
# File 'lib/pdfh/utils/options.rb', line 6 def files @files end |
#type ⇒ Object (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
24 25 26 |
# File 'lib/pdfh/utils/options.rb', line 24 def dry? @dry end |
#file_mode? ⇒ Boolean
29 30 31 |
# File 'lib/pdfh/utils/options.rb', line 29 def file_mode? @mode == :file end |
#files? ⇒ Boolean
34 35 36 |
# File 'lib/pdfh/utils/options.rb', line 34 def files? !!@files&.any? end |
#verbose? ⇒ Boolean
19 20 21 |
# File 'lib/pdfh/utils/options.rb', line 19 def verbose? @verbose end |