Class: Myfdb::Batch
- Inherits:
-
Object
- Object
- Myfdb::Batch
- Includes:
- Batch::Images
- Defined in:
- lib/myfdb/batch.rb
Instance Attribute Summary collapse
-
#directory ⇒ Object
readonly
Returns the value of attribute directory.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize(directory, uri) ⇒ Batch
constructor
A new instance of Batch.
- #store! ⇒ Object
Methods included from Batch::Images
#images, #images?, included, #process_images
Constructor Details
#initialize(directory, uri) ⇒ Batch
Returns a new instance of Batch.
9 10 11 12 13 |
# File 'lib/myfdb/batch.rb', line 9 def initialize(directory, uri) @directory = directory @errors = [] @uri = uri end |
Instance Attribute Details
#directory ⇒ Object (readonly)
Returns the value of attribute directory.
7 8 9 |
# File 'lib/myfdb/batch.rb', line 7 def directory @directory end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
7 8 9 |
# File 'lib/myfdb/batch.rb', line 7 def errors @errors end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
7 8 9 |
# File 'lib/myfdb/batch.rb', line 7 def uri @uri end |
Instance Method Details
#id ⇒ Object
19 20 21 22 23 24 |
# File 'lib/myfdb/batch.rb', line 19 def id @id ||= File.read(File.join directory, 'issue_id') rescue Errno::ENOENT response = create_issue response.is_a?(Integer) ? @id = response : errors << response end |
#store! ⇒ Object
15 16 17 |
# File 'lib/myfdb/batch.rb', line 15 def store! id && process_images if images? end |