Class: MuPDF::Info
- Inherits:
-
Object
- Object
- MuPDF::Info
- Defined in:
- lib/mupdf/info.rb
Overview
A wrapper for the result of a ‘mutool info …` command.
Constant Summary collapse
- PARSE_REGEX =
/^Pages: (?<pages>\d+)$/
Instance Attribute Summary collapse
-
#description ⇒ String
The description of the task.
-
#pages ⇒ Object
readonly
Returns the value of attribute pages.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(pages:) ⇒ Info
constructor
A new instance of Info.
Constructor Details
#initialize(pages:) ⇒ Info
Returns a new instance of Info.
21 22 23 |
# File 'lib/mupdf/info.rb', line 21 def initialize(pages:) @pages = pages end |
Instance Attribute Details
#description ⇒ String
Returns The description of the task.
10 |
# File 'lib/mupdf/info.rb', line 10 attr_reader :pages |
#pages ⇒ Object (readonly)
Returns the value of attribute pages.
10 11 12 |
# File 'lib/mupdf/info.rb', line 10 def pages @pages end |
Class Method Details
.parse(text) ⇒ MuPDF::Info
15 16 17 18 |
# File 'lib/mupdf/info.rb', line 15 def self.parse(text) match = text.match(PARSE_REGEX) new(pages: Integer(match[:pages])) end |