class Archdown::Library
The Library
knows about its locations for books (e.g. file directory)
Attributes
path[R]
Public Class Methods
new(path)
click to toggle source
# File lib/archdown/library.rb, line 6 def initialize(path) @path = path end
Public Instance Methods
first(identifier)
click to toggle source
# File lib/archdown/library.rb, line 10 def first(identifier) identifier[0..1].downcase end
last(identifier)
click to toggle source
# File lib/archdown/library.rb, line 14 def last(identifier) identifier[-2..-1].downcase end
path_for_identifier(identifier, *parts)
click to toggle source
# File lib/archdown/library.rb, line 18 def path_for_identifier(identifier, *parts) File.join(path, first(identifier), last(identifier), identifier, *parts) end