Class: ViewModel::BaseViewModel
- Inherits:
-
Object
- Object
- ViewModel::BaseViewModel
- Defined in:
- lib/view_model/base_view_model.rb
Direct Known Subclasses
Cepc31::CommonSchema, Cepc40::CommonSchema, Cepc50::CommonSchema, Cepc51::CommonSchema, Cepc60::CommonSchema, Cepc70::CommonSchema, Cepc71::CommonSchema, Cepc800::CommonSchema, CepcNi800::CommonSchema, DomesticEpcViewModel
Instance Method Summary collapse
-
#initialize(xml_doc) ⇒ BaseViewModel
constructor
A new instance of BaseViewModel.
- #xpath(queries, node = @xml_doc) ⇒ Object
Constructor Details
#initialize(xml_doc) ⇒ BaseViewModel
Returns a new instance of BaseViewModel.
5 6 7 |
# File 'lib/view_model/base_view_model.rb', line 5 def initialize(xml_doc) @xml_doc = xml_doc end |
Instance Method Details
#xpath(queries, node = @xml_doc) ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/view_model/base_view_model.rb', line 9 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 |