Class: Hyrax::Ingest::Fetcher::YAMLFile
- Includes:
- HasSIP
- Defined in:
- lib/hyrax/ingest/fetcher/yaml_file.rb
Instance Attribute Summary collapse
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#yaml_path ⇒ Object
readonly
Returns the value of attribute yaml_path.
Instance Method Summary collapse
- #fetch ⇒ Object
-
#initialize(options = {}) ⇒ YAMLFile
constructor
A new instance of YAMLFile.
Methods included from HasSIP
Methods inherited from Base
Methods included from HasLogger
Methods included from HasReport
Constructor Details
#initialize(options = {}) ⇒ YAMLFile
Returns a new instance of YAMLFile.
15 16 17 18 19 20 21 |
# File 'lib/hyrax/ingest/fetcher/yaml_file.rb', line 15 def initialize(={}) raise ArgumentError, "Required option :filename is missing" unless .key?(:filename) raise ArgumentError, "Required option :yaml_path is missing" unless .key?(:yaml_path) @filename = [:filename] @yaml_path = [:yaml_path] super end |
Instance Attribute Details
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
13 14 15 |
# File 'lib/hyrax/ingest/fetcher/yaml_file.rb', line 13 def filename @filename end |
#yaml_path ⇒ Object (readonly)
Returns the value of attribute yaml_path.
13 14 15 |
# File 'lib/hyrax/ingest/fetcher/yaml_file.rb', line 13 def yaml_path @yaml_path end |
Instance Method Details
#fetch ⇒ Object
23 24 25 |
# File 'lib/hyrax/ingest/fetcher/yaml_file.rb', line 23 def fetch @fetched_value ||= yaml.dig(*yaml_path) end |