Class: Apidoco::ResourceDocumentation
- Inherits:
-
Object
- Object
- Apidoco::ResourceDocumentation
- Defined in:
- lib/apidoco/resource_documentation.rb
Instance Attribute Summary collapse
-
#directory ⇒ Object
Returns the value of attribute directory.
Instance Method Summary collapse
- #as_json ⇒ Object
- #children ⇒ Object
-
#initialize(directory) ⇒ ResourceDocumentation
constructor
A new instance of ResourceDocumentation.
Constructor Details
#initialize(directory) ⇒ ResourceDocumentation
Returns a new instance of ResourceDocumentation.
5 6 7 |
# File 'lib/apidoco/resource_documentation.rb', line 5 def initialize(directory) self.directory = directory end |
Instance Attribute Details
#directory ⇒ Object
Returns the value of attribute directory.
3 4 5 |
# File 'lib/apidoco/resource_documentation.rb', line 3 def directory @directory end |
Instance Method Details
#as_json ⇒ Object
9 10 11 |
# File 'lib/apidoco/resource_documentation.rb', line 9 def as_json children.map { |c| JSON.parse(File.read(c)) } end |
#children ⇒ Object
13 14 15 16 17 |
# File 'lib/apidoco/resource_documentation.rb', line 13 def children directory.children.select do |child| child.extname.eql?('.json') end end |