Sha256: d907de7a7a589bd2e075aa90a110aa7970f7f5bfc9658e6f8ecca33f28d06130

Contents?: true

Size: 324 Bytes

Versions: 47

Compression:

Stored size: 324 Bytes

Contents

module ViewModel
  class BaseViewModel
    def initialize(xml_doc)
      @xml_doc = xml_doc
    end

    def xpath(queries, node = @xml_doc)
      queries.each do |query|
        if node
          node = node.at query
        else
          return nil
        end
      end
      node ? node.content : nil
    end
  end
end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
epb_view_models-1.0.26 lib/view_model/base_view_model.rb
epb_view_models-1.0.25 lib/view_model/base_view_model.rb
epb_view_models-1.0.24 lib/view_model/base_view_model.rb
epb_view_models-1.0.23 lib/view_model/base_view_model.rb
epb_view_models-1.0.22 lib/view_model/base_view_model.rb
epb_view_models-1.0.21 lib/view_model/base_view_model.rb
epb_view_models-1.0.20 lib/view_model/base_view_model.rb
epb_view_models-1.0.19 lib/view_model/base_view_model.rb
epb_view_models-1.0.18 lib/view_model/base_view_model.rb
epb_view_models-1.0.17 lib/view_model/base_view_model.rb
epb_view_models-1.0.16 lib/view_model/base_view_model.rb
epb_view_models-1.0.15 lib/view_model/base_view_model.rb
epb_view_models-1.0.14 lib/view_model/base_view_model.rb
epb_view_models-1.0.13 lib/view_model/base_view_model.rb
epb_view_models-1.0.12 lib/view_model/base_view_model.rb
epb_view_models-1.0.11 lib/view_model/base_view_model.rb
epb_view_models-1.0.10 lib/view_model/base_view_model.rb
epb_view_models-1.0.9 lib/view_model/base_view_model.rb
epb_view_models-1.0.8 lib/view_model/base_view_model.rb
epb_view_models-1.0.7 lib/view_model/base_view_model.rb