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.
78 79 80 81 |
# File 'lib/raddocs/models.rb', line 78 def initialize(attributes) @title = attributes.fetch("title") @file = attributes.fetch("file") end |
Instance Attribute Details
#title ⇒ Object (readonly)
Returns the value of attribute title.
76 77 78 |
# File 'lib/raddocs/models.rb', line 76 def title @title end |
Instance Method Details
#href ⇒ Object
83 84 85 86 |
# File 'lib/raddocs/models.rb', line 83 def href filename = @file.gsub(".md", "") "guides/#{filename}" end |