lib/rambo/raml_models/method.rb in rambo_ruby-0.2.3 vs lib/rambo/raml_models/method.rb in rambo_ruby-0.3.0
- old
+ new
@@ -1,12 +1,13 @@
module Rambo
module RamlModels
class Method
attr_reader :schema
- def initialize(raml_method)
- @schema = raml_method
+ def initialize(raml_method, headers=Headers.new({}))
+ @schema = raml_method
+ @headers = headers
end
def method
schema.method
end
@@ -18,10 +19,10 @@
def description
@description ||= schema.description
end
def headers
- @headers ||= Rambo::RamlModels::Headers.new(schema.headers) if schema.headers
+ @headers.add(schema.headers) if schema.headers
end
def responses
@responses ||= schema.responses.map {|resp| Rambo::RamlModels::Response.new(resp) }
end