Class: Diary::Item::Base
- Inherits:
-
Object
- Object
- Diary::Item::Base
- Defined in:
- lib/diary/item/base.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Class Method Summary collapse
Instance Method Summary collapse
- #basename ⇒ Object
- #classname ⇒ Object
-
#initialize(path) ⇒ Base
constructor
A new instance of Base.
Methods included from Creator
Methods included from Finder
Constructor Details
#initialize(path) ⇒ Base
Returns a new instance of Base.
6 7 8 |
# File 'lib/diary/item/base.rb', line 6 def initialize(path) @path = path end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
4 5 6 |
# File 'lib/diary/item/base.rb', line 4 def path @path end |
Class Method Details
.base_directory ⇒ Object
18 19 20 |
# File 'lib/diary/item/base.rb', line 18 def self.base_directory self.name.downcase.pluralize end |
Instance Method Details
#basename ⇒ Object
10 11 12 |
# File 'lib/diary/item/base.rb', line 10 def basename File.basename(path, '.md') end |
#classname ⇒ Object
14 15 16 |
# File 'lib/diary/item/base.rb', line 14 def classname self.class.name.downcase end |