class ApiSketch::DSL::Responses
Public Class Methods
new(&block)
click to toggle source
# File lib/api_sketch/dsl/responses.rb, line 3 def initialize(&block) @list = [] define_singleton_method(:initialize_responses_list, block) initialize_responses_list end
Public Instance Methods
context(name, &block)
click to toggle source
# File lib/api_sketch/dsl/responses.rb, line 13 def context(name, &block) attributes = ::ApiSketch::DSL::AttributeParser.new(:root, &block).to_h if attributes[:parameters] params = ::ApiSketch::DSL::Parameters.new(&attributes[:parameters]).to_h attributes[:parameters] = ::ApiSketch::Model::Parameters.new(params) end @list << ::ApiSketch::Model::Response.new(attributes.merge(name: name)) end
to_a()
click to toggle source
# File lib/api_sketch/dsl/responses.rb, line 9 def to_a @list end