class Raml::Parser::Documentation

Constants

BASIC_ATTRIBUTES

Attributes

attributes[RW]
documentation[RW]

Public Instance Methods

parse(attributes) click to toggle source
# File lib/raml/parser/documentation.rb, line 13
def parse(attributes)
  @documentation = Raml::Documentation.new
  @attributes = prepare_attributes(attributes)

  parse_attributes

  documentation
end

Private Instance Methods

parse_attributes() click to toggle source
# File lib/raml/parser/documentation.rb, line 24
def parse_attributes
  attributes.each do |key, value|
    case key
    when *BASIC_ATTRIBUTES
      documentation.send("#{key}=".to_sym, value)
    else
      raise UnknownAttributeError.new "Unknown documentation key: #{key}"
    end
  end if attributes
end