Class: Blogster::Template
- Inherits:
-
Object
- Object
- Blogster::Template
- Defined in:
- lib/blogster/templates.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #file ⇒ Object
- #fullpath ⇒ Object
-
#initialize(path, name) ⇒ Template
constructor
A new instance of Template.
- #name ⇒ Object
Constructor Details
#initialize(path, name) ⇒ Template
Returns a new instance of Template.
29 30 31 32 |
# File 'lib/blogster/templates.rb', line 29 def initialize(path, name) @path = path @name = name end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
27 28 29 |
# File 'lib/blogster/templates.rb', line 27 def path @path end |
Instance Method Details
#==(other) ⇒ Object
46 47 48 49 |
# File 'lib/blogster/templates.rb', line 46 def ==(other) name == other.name && path == other.path end |
#file ⇒ Object
34 35 36 |
# File 'lib/blogster/templates.rb', line 34 def file File.read(fullpath) end |
#fullpath ⇒ Object
38 39 40 |
# File 'lib/blogster/templates.rb', line 38 def fullpath File.join(path, @name) end |
#name ⇒ Object
42 43 44 |
# File 'lib/blogster/templates.rb', line 42 def name @suffixless_name ||= @name.delete('.md') end |