Class: Axis::Document::Base
- Inherits:
-
Object
- Object
- Axis::Document::Base
- Extended by:
- FinderMethods
- Defined in:
- lib/axis/document.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #created_on ⇒ Object
- #id ⇒ Object
-
#initialize(path) ⇒ Base
constructor
A new instance of Base.
- #type ⇒ Object
Methods included from FinderMethods
Constructor Details
#initialize(path) ⇒ Base
Returns a new instance of Base.
51 52 53 54 55 |
# File 'lib/axis/document.rb', line 51 def initialize(path) @path = Pathname.new(path) @filename_split = @path.basename.to_s.split("_") @dirname_split = @path.dirname.split end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
49 50 51 |
# File 'lib/axis/document.rb', line 49 def path @path end |
Instance Method Details
#created_on ⇒ Object
65 66 67 |
# File 'lib/axis/document.rb', line 65 def created_on Date.parse(@filename_split[2]) end |
#id ⇒ Object
57 58 59 |
# File 'lib/axis/document.rb', line 57 def id @filename_split.first end |