Class: Nokogiri::XML::Element

Inherits:
Object
  • Object
show all
Defined in:
lib/ever_exp/nokogiri_xml_element.rb

Instance Method Summary collapse

Instance Method Details

#plain_codeObject

Raises:

  • (NoMethodError)


3
4
5
6
7
8
# File 'lib/ever_exp/nokogiri_xml_element.rb', line 3

def plain_code
  raise NoMethodError, "#{self} is not a code block" unless self['style'] =~ /^-en-codeblock/
  css('div').
    map{ |line| _plain_code line }.
    join("\n")
end