Class: ClockworkComicPDF::Section
- Inherits:
-
Object
- Object
- ClockworkComicPDF::Section
- Includes:
- OptionValidation
- Defined in:
- lib/clockwork_comic_pdf/section.rb
Overview
this is the base class for sections data that stores common section info
Direct Known Subclasses
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
- #print_section_intro ⇒ Object
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Section
constructor
A new instance of Section.
- #req_keys ⇒ Object
- #valid_options ⇒ Object
- #validate ⇒ Object
Methods included from OptionValidation
#check_options, #check_required
Constructor Details
#initialize(options = {}) ⇒ Section
Returns a new instance of Section.
89 90 91 92 93 |
# File 'lib/clockwork_comic_pdf/section.rb', line 89 def initialize( = {}) self.name = [:name] self.type = [:type] self.print_section_intro = [:print_section_intro] end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
75 76 77 |
# File 'lib/clockwork_comic_pdf/section.rb', line 75 def name @name end |
#print_section_intro ⇒ Object
69 70 71 72 |
# File 'lib/clockwork_comic_pdf/section.rb', line 69 def print_section_intro @print_section_intro = false if @print_section_intro.nil? @print_section_intro end |
#type ⇒ Object
Returns the value of attribute type.
74 75 76 |
# File 'lib/clockwork_comic_pdf/section.rb', line 74 def type @type end |
Instance Method Details
#req_keys ⇒ Object
81 82 83 |
# File 'lib/clockwork_comic_pdf/section.rb', line 81 def req_keys @required_keys = { name: @name } end |
#valid_options ⇒ Object
77 78 79 |
# File 'lib/clockwork_comic_pdf/section.rb', line 77 def @valid_options = [:print_section_intro, :type, :name] end |
#validate ⇒ Object
85 86 87 |
# File 'lib/clockwork_comic_pdf/section.rb', line 85 def validate check_required(req_keys) end |