lib/lurker/endpoint.rb in lurker-0.6.9 vs lib/lurker/endpoint.rb in lurker-0.6.10

- old
+ new

@@ -17,11 +17,11 @@ DEPRECATED = 'deprecated'.freeze DESCRIPTION = 'description'.freeze RESPONSE_CODES = 'responseCodes'.freeze REQUEST_PARAMETERS = 'requestParameters'.freeze RESPONSE_PARAMETERS = 'responseParameters'.freeze - DESCRPTIONS = { + DESCRIPTIONS = { 'index' => 'listing', 'show' => '', 'edit' => 'editing', 'create' => 'creation', 'update' => 'updating', @@ -42,11 +42,11 @@ def persist! finalize_schema! Lurker::Json::Orderer.reorder(schema) unless persisted? - Lurker::Json::Writter.write(schema, endpoint_path) + Lurker::Json::Writer.write(schema, endpoint_path) @persisted = true end def indexed? @@ -129,10 +129,14 @@ def response_codes @schema[RESPONSE_CODES] end + def documentation + @schema.documentation + end + protected def persisted? !!@persisted end @@ -165,10 +169,10 @@ end def finalize_schema! path_params = schema[EXTENSIONS][PATH_PARAMS] || {} subject = path_params[CONTROLLER].to_s.split(/\//).last.to_s - description = DESCRPTIONS[path_params[ACTION]] + description = DESCRIPTIONS[path_params[ACTION]] schema[DESCRIPTION] = "#{subject.singularize} #{description}".strip if schema[DESCRIPTION].blank? schema[PREFIX] = "#{subject} management" if schema[PREFIX].blank? end