Class: Ncn::NotePathBuilder
- Inherits:
-
Object
- Object
- Ncn::NotePathBuilder
- Defined in:
- lib/ncn/note_path_builder.rb
Instance Attribute Summary collapse
-
#created ⇒ Object
readonly
Returns the value of attribute created.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
- #directory_names ⇒ Object
-
#initialize(created:, id:) ⇒ NotePathBuilder
constructor
A new instance of NotePathBuilder.
- #path ⇒ Object
Constructor Details
#initialize(created:, id:) ⇒ NotePathBuilder
Returns a new instance of NotePathBuilder.
5 6 7 8 |
# File 'lib/ncn/note_path_builder.rb', line 5 def initialize(created:, id:) @id = id @created = created end |
Instance Attribute Details
#created ⇒ Object (readonly)
Returns the value of attribute created.
3 4 5 |
# File 'lib/ncn/note_path_builder.rb', line 3 def created @created end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/ncn/note_path_builder.rb', line 3 def id @id end |
Instance Method Details
#directory_names ⇒ Object
14 15 16 |
# File 'lib/ncn/note_path_builder.rb', line 14 def directory_names [year, month, day] end |
#path ⇒ Object
10 11 12 |
# File 'lib/ncn/note_path_builder.rb', line 10 def path File.join(*directory_names, "#{id}.md") end |