Class: MarkupModel::ModelFile
- Inherits:
-
Object
- Object
- MarkupModel::ModelFile
- Defined in:
- lib/markup_model/model_file.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #attributes ⇒ Object
- #content ⇒ Object
- #id ⇒ Object
-
#initialize(path) ⇒ ModelFile
constructor
A new instance of ModelFile.
Constructor Details
#initialize(path) ⇒ ModelFile
Returns a new instance of ModelFile.
5 6 7 8 |
# File 'lib/markup_model/model_file.rb', line 5 def initialize(path) @attributes = nil @path = path end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'lib/markup_model/model_file.rb', line 3 def path @path end |
Instance Method Details
#attributes ⇒ Object
10 11 12 13 |
# File 'lib/markup_model/model_file.rb', line 10 def attributes read_attributes @attributes end |
#content ⇒ Object
15 16 17 18 |
# File 'lib/markup_model/model_file.rb', line 15 def content read_attributes @content end |
#id ⇒ Object
20 21 22 |
# File 'lib/markup_model/model_file.rb', line 20 def id File.basename(path).sub(/\.md$/i, "").sub(/^0*/, "") end |