Class: Raddocs::Guide
- Inherits:
-
Object
- Object
- Raddocs::Guide
- Defined in:
- lib/raddocs/models.rb
Overview
Guide page model
Instance Attribute Summary collapse
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #href ⇒ Object
-
#initialize(attributes) ⇒ Guide
constructor
A new instance of Guide.
Constructor Details
#initialize(attributes) ⇒ Guide
Returns a new instance of Guide.
69 70 71 72 |
# File 'lib/raddocs/models.rb', line 69 def initialize(attributes) @title = attributes.fetch("title") @file = attributes.fetch("file") end |
Instance Attribute Details
#title ⇒ Object (readonly)
Returns the value of attribute title.
67 68 69 |
# File 'lib/raddocs/models.rb', line 67 def title @title end |
Instance Method Details
#href ⇒ Object
74 75 76 77 |
# File 'lib/raddocs/models.rb', line 74 def href filename = @file.gsub(".md", "") "guides/#{filename}" end |