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.



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

#titleObject (readonly)

Returns the value of attribute title.



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

def title
  @title
end

Instance Method Details

#hrefObject



83
84
85
86
# File 'lib/raddocs/models.rb', line 83

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