Class: NewspaperWorks::Ingest::NDNP::ContainerIngest
- Inherits:
-
Object
- Object
- NewspaperWorks::Ingest::NDNP::ContainerIngest
- Includes:
- Enumerable, NDNPMetsHelper
- Defined in:
- lib/newspaper_works/ingest/ndnp/container_ingest.rb
Constant Summary
Constants included from NDNPMetsHelper
Instance Attribute Summary collapse
-
#dmdids ⇒ Object
Returns the value of attribute dmdids.
-
#doc ⇒ Object
Returns the value of attribute doc.
-
#issue_paths ⇒ Object
Returns the value of attribute issue_paths.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
- #each ⇒ Object
- #identifier ⇒ Object
-
#initialize(path) ⇒ ContainerIngest
constructor
A new instance of ContainerIngest.
- #inspect ⇒ Object
-
#issue_by_path(path) ⇒ Object
Get IssueIngest object, given path to its XML return [NewspaperWorks::Ingest::NDNP::IssueIngest].
- #metadata ⇒ Object
-
#page_by_dmdid(dmdid) ⇒ NewspaperWorks::Ingest::NDNP::PageIngest
Return control image as PageIngest object.
- #size ⇒ Object
Methods included from NDNPMetsHelper
#container, #container_path, #dmd_node, #normalize_path, #page_files, #xpath
Constructor Details
#initialize(path) ⇒ ContainerIngest
Returns a new instance of ContainerIngest.
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/newspaper_works/ingest/ndnp/container_ingest.rb', line 11 def initialize(path) @path = path @doc = nil @metadata = nil # identifiers of control images, which we make accessible, but are # not the primary focus of enumeration: @dmdids = nil @issue_paths = [] load_doc end |
Instance Attribute Details
#dmdids ⇒ Object
Returns the value of attribute dmdids.
9 10 11 |
# File 'lib/newspaper_works/ingest/ndnp/container_ingest.rb', line 9 def dmdids @dmdids end |
#doc ⇒ Object
Returns the value of attribute doc.
9 10 11 |
# File 'lib/newspaper_works/ingest/ndnp/container_ingest.rb', line 9 def doc @doc end |
#issue_paths ⇒ Object
Returns the value of attribute issue_paths.
9 10 11 |
# File 'lib/newspaper_works/ingest/ndnp/container_ingest.rb', line 9 def issue_paths @issue_paths end |
#path ⇒ Object
Returns the value of attribute path.
9 10 11 |
# File 'lib/newspaper_works/ingest/ndnp/container_ingest.rb', line 9 def path @path end |
Instance Method Details
#each ⇒ Object
49 50 51 52 53 |
# File 'lib/newspaper_works/ingest/ndnp/container_ingest.rb', line 49 def each @issue_paths.each do |path| yield issue_by_path(path) end end |
#identifier ⇒ Object
30 31 32 |
# File 'lib/newspaper_works/ingest/ndnp/container_ingest.rb', line 30 def identifier .reel_number end |
#inspect ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/newspaper_works/ingest/ndnp/container_ingest.rb', line 22 def inspect format( "<#{self.class}:0x000000000%<oid>x\n" \ "\tpath: '#{path}',\n", oid: object_id << 1 ) end |
#issue_by_path(path) ⇒ Object
Get IssueIngest object, given path to its XML return [NewspaperWorks::Ingest::NDNP::IssueIngest]
45 46 47 |
# File 'lib/newspaper_works/ingest/ndnp/container_ingest.rb', line 45 def issue_by_path(path) NewspaperWorks::Ingest::NDNP::IssueIngest.new(path) end |
#metadata ⇒ Object
59 60 61 62 63 64 65 |
# File 'lib/newspaper_works/ingest/ndnp/container_ingest.rb', line 59 def return @metadata unless @metadata.nil? @metadata = NewspaperWorks::Ingest::NDNP::ContainerMetadata.new( path, self ) end |
#page_by_dmdid(dmdid) ⇒ NewspaperWorks::Ingest::NDNP::PageIngest
Return control image as PageIngest object.
These objects will not have pagination/sequence data, but
will provide an equivalent programmatic interface for file access
of control images, as one would access normal page files.
39 40 41 |
# File 'lib/newspaper_works/ingest/ndnp/container_ingest.rb', line 39 def page_by_dmdid(dmdid) NewspaperWorks::Ingest::NDNP::PageIngest.new(@path, dmdid, self) end |
#size ⇒ Object
55 56 57 |
# File 'lib/newspaper_works/ingest/ndnp/container_ingest.rb', line 55 def size @issue_paths.size end |