Class: KjDotXml
- Inherits:
-
Object
- Object
- KjDotXml
- Defined in:
- lib/kjdotxml.rb
Instance Method Summary collapse
- #book(s) ⇒ Object
- #books ⇒ Object
-
#initialize ⇒ KjDotXml
constructor
A new instance of KjDotXml.
Constructor Details
#initialize ⇒ KjDotXml
Returns a new instance of KjDotXml.
82 83 |
# File 'lib/kjdotxml.rb', line 82 def initialize() end |
Instance Method Details
#book(s) ⇒ Object
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/kjdotxml.rb', line 85 def book(s) #filepath = File.join('/tmp', s.downcase.gsub(/\s/,'-') + '.xml') filename = s.downcase.gsub(/\s/,'-') + '.xml' filepath = File.join(File.dirname(__FILE__), '..', 'xml', filename) if File.exists? filepath then contents = File.read(filepath) Rexle.new(contents) else raise KjDotXmlError, 'book not found' end end |
#books ⇒ Object
102 103 104 |
# File 'lib/kjdotxml.rb', line 102 def books() BOOKS end |