Module: Nikkou::Drillable

Included in:
Nokogiri::XML::Node, Nokogiri::XML::NodeSet
Defined in:
lib/nikkou/drillable.rb

Instance Method Summary collapse

Instance Method Details

#drill(*methods) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/nikkou/drillable.rb', line 3

def drill(*methods)
  value = self
  methods.each do |method|
    if method.is_a?(Array)
      value = value.send(*method)
    else
      value = value.send(method)
    end
    return nil if value.blank?
  end
  value
end