Class: Raddocs::Guide

Inherits:
Object
  • Object
show all
Defined in:
lib/raddocs/models.rb

Overview

Guide page model

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#titleObject (readonly)

Returns the value of attribute title.



67
68
69
# File 'lib/raddocs/models.rb', line 67

def title
  @title
end

Instance Method Details

#hrefObject



74
75
76
77
# File 'lib/raddocs/models.rb', line 74

def href
  filename = @file.gsub(".md", "")
  "guides/#{filename}"
end