Sha256: 8d385f960ac505eb336ceddcae0ce5756aa583a7b78c0853de1fe1604cdf013e

Contents?: true

Size: 535 Bytes

Versions: 1

Compression:

Stored size: 535 Bytes

Contents

require "swagger_roar/version"

module SwaggerRoar
  def documentation
    Hash[
      representable_attrs.keys.map { |k|
        key_to_doc_entry(k)
      }
    ]
  end

  private

  def key_to_doc_entry(k)
    [key_to_doc_key(k), key_to_doc(k)]
  end

  def key_to_doc_key(k)
    return unless representable_attrs.has_key? k
    definition = representable_attrs[k]
    return definition[:as].evaluate({}).to_sym if definition[:as].present?
    k.to_sym
  end

  def key_to_doc(k)
    representable_attrs[k][:documentation]
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
swagger_roar-0.0.1.pre.alpha.pre.13 lib/swagger_roar.rb