Class: NokogiriNotepad::Parser
- Inherits:
-
Object
- Object
- NokogiriNotepad::Parser
- Defined in:
- lib/nokogiri-notepad/parser.rb
Instance Attribute Summary collapse
-
#accepted_extensions ⇒ Object
Returns the value of attribute accepted_extensions.
-
#file_path ⇒ Object
readonly
Returns the value of attribute file_path.
-
#multiple_targets ⇒ Object
readonly
Returns the value of attribute multiple_targets.
-
#single_targets ⇒ Object
readonly
Returns the value of attribute single_targets.
Instance Method Summary collapse
- #extensions ⇒ Object
-
#initialize(file_path, single_targets, multiple_targets, extensions = nil) ⇒ Parser
constructor
A new instance of Parser.
Constructor Details
#initialize(file_path, single_targets, multiple_targets, extensions = nil) ⇒ Parser
Returns a new instance of Parser.
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/nokogiri-notepad/parser.rb', line 11 def initialize(file_path, single_targets, multiple_targets, extensions = nil) @file_path = file_path @single_targets = single_targets @multiple_targets = multiple_targets @accepted_extensions = [".xml"] add_extensions(extensions) if extensions validate_input doc = load_nokogiri_doc file_path @node_finder = NodeFinder.new doc initialize_data doc = nil @node_finder = nil end |
Instance Attribute Details
#accepted_extensions ⇒ Object
Returns the value of attribute accepted_extensions.
8 9 10 |
# File 'lib/nokogiri-notepad/parser.rb', line 8 def accepted_extensions @accepted_extensions end |
#file_path ⇒ Object (readonly)
Returns the value of attribute file_path.
9 10 11 |
# File 'lib/nokogiri-notepad/parser.rb', line 9 def file_path @file_path end |
#multiple_targets ⇒ Object (readonly)
Returns the value of attribute multiple_targets.
9 10 11 |
# File 'lib/nokogiri-notepad/parser.rb', line 9 def multiple_targets @multiple_targets end |
#single_targets ⇒ Object (readonly)
Returns the value of attribute single_targets.
9 10 11 |
# File 'lib/nokogiri-notepad/parser.rb', line 9 def single_targets @single_targets end |
Instance Method Details
#extensions ⇒ Object
25 26 27 |
# File 'lib/nokogiri-notepad/parser.rb', line 25 def extensions @accepted_extensions end |