Class: ClockworkComicPDF::Cover
- Inherits:
-
Object
- Object
- ClockworkComicPDF::Cover
- Includes:
- OptionValidation
- Defined in:
- lib/clockwork_comic_pdf/cover.rb
Overview
this contains the size, file path, and size of the cover
Instance Attribute Summary collapse
-
#file ⇒ Object
Returns the value of attribute file.
-
#path ⇒ Object
Returns the value of attribute path.
-
#size ⇒ Object
Returns the value of attribute size.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Cover
constructor
A new instance of Cover.
- #validate ⇒ Object
Methods included from OptionValidation
#check_options, #check_required
Constructor Details
#initialize(options = {}) ⇒ Cover
Returns a new instance of Cover.
35 36 37 38 39 40 |
# File 'lib/clockwork_comic_pdf/cover.rb', line 35 def initialize( = {}) (.keys, [:size, :path, :file]) self.path = [:path] self.size = [:size] self.file = [:file] end |
Instance Attribute Details
#file ⇒ Object
Returns the value of attribute file.
24 25 26 |
# File 'lib/clockwork_comic_pdf/cover.rb', line 24 def file @file end |
#path ⇒ Object
Returns the value of attribute path.
19 20 21 |
# File 'lib/clockwork_comic_pdf/cover.rb', line 19 def path @path end |
#size ⇒ Object
Returns the value of attribute size.
9 10 11 |
# File 'lib/clockwork_comic_pdf/cover.rb', line 9 def size @size end |
Instance Method Details
#validate ⇒ Object
29 30 31 32 33 |
# File 'lib/clockwork_comic_pdf/cover.rb', line 29 def validate fail InvalidValueError, 'Cover Must specify a file' unless file fail InvalidValueError, 'Cover must specify a size' unless size fail InvalidValueError, 'Cover must specify a path' unless path end |