Class: INatGet::Data::Parser::Part::Copy Private
- Inherits:
-
INatGet::Data::Parser::Part
- Object
- INatGet::Data::Parser::Part
- INatGet::Data::Parser::Part::Copy
- Defined in:
- lib/inat-get/data/parsers/defs/copy.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary
Attributes inherited from INatGet::Data::Parser::Part
Instance Method Summary collapse
-
#initialize(parser, *names, **aliases) ⇒ Copy
constructor
private
A new instance of Copy.
- #parse(source) ⇒ Object private
Constructor Details
#initialize(parser, *names, **aliases) ⇒ Copy
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Copy.
7 8 9 10 11 |
# File 'lib/inat-get/data/parsers/defs/copy.rb', line 7 def initialize parser, *names, **aliases super parser @names = names @aliases = aliases end |
Instance Method Details
#parse(source) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/inat-get/data/parsers/defs/copy.rb', line 13 def parse source result = {} @names.each do |name| result[name] = source[name] end @aliases.each do |name, src_name| result[name] = source[src_name] end result end |