lib/apipie/method_description.rb in apipie-rails-0.3.2 vs lib/apipie/method_description.rb in apipie-rails-0.3.3
- old
+ new
@@ -15,11 +15,11 @@
@options = options
end
end
- attr_reader :full_description, :method, :resource, :apis, :examples, :see, :formats, :metadata
+ attr_reader :full_description, :method, :resource, :apis, :examples, :see, :formats, :metadata, :headers
def initialize(method, resource, dsl_data)
@method = method.to_s
@resource = resource
@from_concern = dsl_data[:from_concern]
@@ -46,10 +46,11 @@
@params_ordered = dsl_data[:params].map do |args|
Apipie::ParamDescription.from_dsl_data(self, args)
end
@params_ordered = ParamDescription.unify(@params_ordered)
+ @headers = dsl_data[:headers]
end
def id
"#{resource._id}##{method}"
end
@@ -140,10 +141,11 @@
:full_description => Apipie.app.translate(@full_description, lang),
:errors => errors.map(&:to_json),
:params => params_ordered.map{ |param| param.to_json(lang) }.flatten,
:examples => @examples,
:metadata => @metadata,
- :see => see.map(&:to_json)
+ :see => see.map(&:to_json),
+ :headers => headers
}
end
# was the description defines in a module instead of directly in controller?
def from_concern?