Class: Raml::Parser::Root

Inherits:
Object
  • Object
show all
Includes:
Util
Defined in:
lib/raml/parser/root.rb

Constant Summary collapse

BASIC_ATTRIBUTES =
%w[title base_uri version base_uri_parameters media_type secured_by security_schemes]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRoot

Returns a new instance of Root.



16
17
18
19
# File 'lib/raml/parser/root.rb', line 16

def initialize
  @traits = {}
  @resource_types = {}
end

Instance Attribute Details

#attributesObject

Returns the value of attribute attributes.



14
15
16
# File 'lib/raml/parser/root.rb', line 14

def attributes
  @attributes
end

#resource_typesObject

Returns the value of attribute resource_types.



14
15
16
# File 'lib/raml/parser/root.rb', line 14

def resource_types
  @resource_types
end

#rootObject

Returns the value of attribute root.



14
15
16
# File 'lib/raml/parser/root.rb', line 14

def root
  @root
end

#traitsObject

Returns the value of attribute traits.



14
15
16
# File 'lib/raml/parser/root.rb', line 14

def traits
  @traits
end

Instance Method Details

#parse(attributes) ⇒ Object



21
22
23
24
25
26
# File 'lib/raml/parser/root.rb', line 21

def parse(attributes)
  @root = Raml::Root.new
  @attributes = prepare_attributes(attributes)
  parse_attributes
  root
end