Class: HaveAPI::Fs::Components::MdHelpFile
- Inherits:
-
HelpFile
- Object
- HaveAPI::Fs::Component
- File
- HelpFile
- HaveAPI::Fs::Components::MdHelpFile
- Defined in:
- lib/haveapi/fs/components/md_help_file.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from HaveAPI::Fs::Component
#atime, #context, #ctime, #mtime
Instance Method Summary collapse
-
#initialize(*args) ⇒ MdHelpFile
constructor
A new instance of MdHelpFile.
- #read ⇒ Object
Methods inherited from File
#file?, #raw_close, #raw_open, #raw_read, #raw_sync, #raw_truncate, #raw_write, #size, #write
Methods inherited from HaveAPI::Fs::Component
#abspath, #bound=, #bound?, children_reader, component, #contents, #directory?, #executable?, #file?, #find, inherited, #invalid?, #invalidate, #parent, #path, #readable?, #reset, #setup, #times, #title, #unsaved?, #use, #writable?
Constructor Details
#initialize(*args) ⇒ MdHelpFile
Returns a new instance of MdHelpFile.
3 4 5 6 7 8 9 10 11 |
# File 'lib/haveapi/fs/components/md_help_file.rb', line 3 def initialize(*args) super @layout = ERB.new(::File.open(template_path('layout')).read, 0, '-') @template = ERB.new( ::File.open(template_path(@c.class)).read, 0, '-' ) end |
Instance Method Details
#read ⇒ Object
13 14 15 16 17 |
# File 'lib/haveapi/fs/components/md_help_file.rb', line 13 def read layout(@layout) do @template.result(binding) end end |