Class: Rdayone::Finder
- Inherits:
-
Object
- Object
- Rdayone::Finder
- Defined in:
- lib/rdayone/finder.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #find_entries ⇒ Object
- #find_photo_for(uuid) ⇒ Object
-
#initialize(path) ⇒ Finder
constructor
A new instance of Finder.
- #uuid_from_path(path) ⇒ Object
Constructor Details
#initialize(path) ⇒ Finder
Returns a new instance of Finder.
5 6 7 |
# File 'lib/rdayone/finder.rb', line 5 def initialize(path) @path = path end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'lib/rdayone/finder.rb', line 3 def path @path end |
Instance Method Details
#find_entries ⇒ Object
9 10 11 |
# File 'lib/rdayone/finder.rb', line 9 def find_entries EntryList.new(Dir["#{@path}/entries/*.doentry"], self) end |
#find_photo_for(uuid) ⇒ Object
13 14 15 |
# File 'lib/rdayone/finder.rb', line 13 def find_photo_for(uuid) Dir["#{@path}/photos/#{uuid}.jpg"].map { |f| File.(f) }[0] end |
#uuid_from_path(path) ⇒ Object
17 18 19 |
# File 'lib/rdayone/finder.rb', line 17 def uuid_from_path(path) File.basename(path, ".*") end |