Class: Raml::Parser::Method

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Util
Defined in:
lib/raml/parser/method.rb

Constant Summary collapse

BASIC_ATTRIBUTES =
%w[description headers]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parent) ⇒ Method

Returns a new instance of Method.



21
22
23
# File 'lib/raml/parser/method.rb', line 21

def initialize(parent)
  @parent = parent
end

Instance Attribute Details

#attributesObject

Returns the value of attribute attributes.



18
19
20
# File 'lib/raml/parser/method.rb', line 18

def attributes
  @attributes
end

#methodObject

Returns the value of attribute method.



18
19
20
# File 'lib/raml/parser/method.rb', line 18

def method
  @method
end

#parentObject

Returns the value of attribute parent.



18
19
20
# File 'lib/raml/parser/method.rb', line 18

def parent
  @parent
end

Instance Method Details

#parse(the_method, attributes) ⇒ Object



25
26
27
28
29
30
31
32
33
34
# File 'lib/raml/parser/method.rb', line 25

def parse(the_method, attributes)
  @method = Raml::Method.new(the_method)
  @attributes = prepare_attributes(attributes)

  apply_parents_traits
  apply_traits
  parse_attributes

  method
end