Class: BeerXML2

Inherits:
Brewser::Engine show all
Defined in:
lib/brewser/engines/beerxml2.rb

Class Method Summary collapse

Class Method Details

.acceptable?(q) ⇒ Boolean

Returns:

  • (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

Raises:

  • (NotImplemented)


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