lib/rambo/raml_models/resource.rb in rambo_ruby-0.2.3 vs lib/rambo/raml_models/resource.rb in rambo_ruby-0.3.0
- old
+ new
@@ -1,22 +1,24 @@
module Rambo
module RamlModels
class Resource
- attr_reader :schema
+ attr_reader :schema, :headers
+ private :headers, :schema
- def initialize(raml_resource)
- @schema = raml_resource
+ def initialize(raml_resource, headers=Rambo::RamlModels::Headers.new({}))
+ @schema = raml_resource
+ @headers = headers
end
def uri_partial
schema.uri_partial
end
alias_method :to_s, :uri_partial
def http_methods
- @http_methods ||= schema.methods.map {|method| Rambo::RamlModels::Method.new(method) }
+ @http_methods ||= schema.http_methods.map {|method| Rambo::RamlModels::Method.new(method, headers) }
end
end
end
end