Class: BeerXML2
- Inherits:
-
Brewser::Engine
- Object
- Brewser::Engine
- BeerXML2
- Defined in:
- lib/brewser/engines/beerxml2.rb
Class Method Summary collapse
- .acceptable?(q) ⇒ Boolean
- .deserialize(string_or_io) ⇒ Object
- .parse_xml(string_or_io) ⇒ Object
- .serialize(brewser_model) ⇒ Object
Class Method Details
.acceptable?(q) ⇒ Boolean
7 8 9 10 |
# File 'lib/brewser/engines/beerxml2.rb', line 7 def acceptable?(q) Nokogiri::XML(q){|config| config.noblanks }.remove_namespaces!.xpath("//version").inner_text.to_i == 2 ? true : false # @TODO Add XSD Validation here end |
.deserialize(string_or_io) ⇒ Object
12 13 14 |
# File 'lib/brewser/engines/beerxml2.rb', line 12 def deserialize(string_or_io) parse_xml(string_or_io) end |
.parse_xml(string_or_io) ⇒ Object
19 20 21 |
# File 'lib/brewser/engines/beerxml2.rb', line 19 def parse_xml(string_or_io) raise NotImplemented, "BeerXML2 support is not implemented yet" end |
.serialize(brewser_model) ⇒ Object
16 17 |
# File 'lib/brewser/engines/beerxml2.rb', line 16 def serialize(brewser_model) end |