Sha256: 0a0b8ba07033f9e2e73a1209ebd4fd47b56d1e3437b9635666491725511c2723

Contents?: true

Size: 561 Bytes

Versions: 12

Compression:

Stored size: 561 Bytes

Contents

module Apidoco
  class VersionDocumentation
    attr_accessor :directory

    def initialize(directory)
      self.directory = directory
    end

    def name
      directory.basename.to_s
    end
    alias_method :version, :name

    def as_json
      {
        name: name,
        base_url: '',
        apis: documentations.flat_map(&:as_json)
      }
    end

    def documentations
      documentation_directories.map { |dir| FolderParser.new(dir) }
    end

    def documentation_directories
      directory.children.select(&:directory?)
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
apidoco-1.6.4 lib/apidoco/version_documentation.rb
apidoco-1.6.3 lib/apidoco/version_documentation.rb
apidoco-1.6.2 lib/apidoco/version_documentation.rb
apidoco-1.6.1 lib/apidoco/version_documentation.rb
apidoco-1.6.0 lib/apidoco/version_documentation.rb
apidoco-1.5.6 lib/apidoco/version_documentation.rb
apidoco-1.5.5 lib/apidoco/version_documentation.rb
apidoco-1.5.4 lib/apidoco/version_documentation.rb
apidoco-1.5.3 lib/apidoco/version_documentation.rb
apidoco-1.5.2 lib/apidoco/version_documentation.rb
apidoco-1.5.1 lib/apidoco/version_documentation.rb
apidoco-1.5.0 lib/apidoco/version_documentation.rb