Class: GrapeDoc::ApiDocParts::ArrayObject
- Inherits:
-
Array
- Object
- Array
- GrapeDoc::ApiDocParts::ArrayObject
- Defined in:
- lib/grape/doc/prototype.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(object) ⇒ ArrayObject
constructor
A new instance of ArrayObject.
- #markdown ⇒ Object
- #to_textile ⇒ Object
Constructor Details
#initialize(object) ⇒ ArrayObject
Returns a new instance of ArrayObject.
55 56 57 58 |
# File 'lib/grape/doc/prototype.rb', line 55 def initialize(object) object = Parser.parse(object) self.replace(object) end |
Class Method Details
.markdown ⇒ Object
50 51 52 |
# File 'lib/grape/doc/prototype.rb', line 50 def markdown @markdown || self.to_s.downcase end |
.markdown=(obj) ⇒ Object
47 48 49 |
# File 'lib/grape/doc/prototype.rb', line 47 def markdown=(obj) @markdown=obj end |
Instance Method Details
#markdown ⇒ Object
60 61 62 |
# File 'lib/grape/doc/prototype.rb', line 60 def markdown self.class.markdown end |
#to_textile ⇒ Object
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/grape/doc/prototype.rb', line 64 def to_textile self.map{|e| case e when ArrayObject e.map{|e| text = if e.respond_to?(:to_textile) e.to_textile else e.to_s end "#{markdown}#{markdown} #{text}" }.join("\n") else "#{markdown} #{e}" end }.join("\n") end |