Class: Raddocs::IndexExample
- Inherits:
-
Object
- Object
- Raddocs::IndexExample
- Defined in:
- lib/raddocs/models.rb
Overview
Example model for the index page
Has an extra link attribute that is required only on this page.
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#link ⇒ Object
readonly
Returns the value of attribute link.
Instance Method Summary collapse
-
#href ⇒ Object
Link to example page is the same name as the file minus “.json”.
-
#initialize(attributes) ⇒ IndexExample
constructor
A new instance of IndexExample.
Constructor Details
#initialize(attributes) ⇒ IndexExample
Returns a new instance of IndexExample.
32 33 34 35 |
# File 'lib/raddocs/models.rb', line 32 def initialize(attributes) @description = attributes.fetch("description") @link = attributes.fetch("link") end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
30 31 32 |
# File 'lib/raddocs/models.rb', line 30 def description @description end |
#link ⇒ Object (readonly)
Returns the value of attribute link.
30 31 32 |
# File 'lib/raddocs/models.rb', line 30 def link @link end |
Instance Method Details
#href ⇒ Object
Link to example page is the same name as the file minus “.json”
38 39 40 |
# File 'lib/raddocs/models.rb', line 38 def href link.gsub(".json", "") end |