class Raml::Parser::Body

Constants

BASIC_ATTRIBUTES
IGNORED_ATTRIBUTES

Attributes

attributes[RW]
body[RW]

Public Instance Methods

parse(type, attributes) click to toggle source
# File lib/raml/parser/body.rb, line 15
def parse(type, attributes)
  @body = Raml::Body.new(type)
  @attributes = prepare_attributes(attributes)

  parse_attributes

  body
end

Private Instance Methods

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