diff options
author | Rhenium <rhenium@rhe.jp> | 2014-01-07 18:15:10 +0900 |
---|---|---|
committer | Rhenium <rhenium@rhe.jp> | 2014-01-07 18:15:10 +0900 |
commit | c4d6fb6bc4b06411949b450b1a6d9f4c58359085 (patch) | |
tree | dbe42d4d07830438ecf4c36be242d2d89ce82c0f /lib/apidoc/endpoint.rb | |
parent | 355f85b7a054a15cc228d448a84e9ee934e45070 (diff) | |
download | aclog-c4d6fb6bc4b06411949b450b1a6d9f4c58359085.tar.gz |
reorganize controllers (add API documentations (lib/apidoc); reorganize auto page loading; add Atom feed)
Diffstat (limited to 'lib/apidoc/endpoint.rb')
-rw-r--r-- | lib/apidoc/endpoint.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/apidoc/endpoint.rb b/lib/apidoc/endpoint.rb new file mode 100644 index 0000000..7d44007 --- /dev/null +++ b/lib/apidoc/endpoint.rb @@ -0,0 +1,24 @@ +module Apidoc + class Endpoint + attr_reader :method, :name, :parameters, :sees + attr_accessor :description + + def initialize(method, name) + @method = method + @name = name + @parameters = [] + @sees = [] + @description = nil + end + + def to_s + "#{method.to_s.upcase} #{name}" + end + + def validate!(params) + parameters.each do |parameter| + parameter.validate!(params) + end + end + end +end |