Class: HpM118dwx4
- Inherits:
-
Object
- Object
- HpM118dwx4
- Defined in:
- lib/hpm118dwx4.rb
Instance Attribute Summary collapse
-
#pages ⇒ Object
Returns the value of attribute pages.
-
#to_html ⇒ Object
readonly
Returns the value of attribute to_html.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(filename = 'page.html', pages: 8, debug: false) ⇒ HpM118dwx4
constructor
A new instance of HpM118dwx4.
- #save(filename = @filename) ⇒ Object
Constructor Details
#initialize(filename = 'page.html', pages: 8, debug: false) ⇒ HpM118dwx4
Returns a new instance of HpM118dwx4.
17 18 19 20 21 |
# File 'lib/hpm118dwx4.rb', line 17 def initialize(filename='page.html', pages: 8, debug: false) @filename, @pages, @debug = filename, [' ']*pages, debug end |
Instance Attribute Details
#pages ⇒ Object
Returns the value of attribute pages.
14 15 16 |
# File 'lib/hpm118dwx4.rb', line 14 def pages @pages end |
#to_html ⇒ Object (readonly)
Returns the value of attribute to_html.
13 14 15 |
# File 'lib/hpm118dwx4.rb', line 13 def to_html @to_html end |
Instance Method Details
#build ⇒ Object
23 24 25 26 |
# File 'lib/hpm118dwx4.rb', line 23 def build() @to_html = build_html @pages @doc = Rexle.new(@to_html) end |
#save(filename = @filename) ⇒ Object
28 29 30 31 |
# File 'lib/hpm118dwx4.rb', line 28 def save(filename=@filename) File.write filename, @doc.xml(pretty: true) File.write filename.sub(/\.html$/, '.css'), css() end |