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.
36 37 38 39 |
# File 'lib/raddocs/models.rb', line 36 def initialize(attributes) @description = attributes.fetch("description") @link = attributes.fetch("link") end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
34 35 36 |
# File 'lib/raddocs/models.rb', line 34 def description @description end |
#link ⇒ Object (readonly)
Returns the value of attribute link.
34 35 36 |
# File 'lib/raddocs/models.rb', line 34 def link @link end |
Instance Method Details
#href ⇒ Object
Link to example page is the same name as the file minus “.json”
42 43 44 |
# File 'lib/raddocs/models.rb', line 42 def href link.gsub(".json", "") end |