Method: Swagger::Blocks::Node.call

Defined in:
lib/swagger/blocks.rb

.call(options = {}, &block) ⇒ Object



215
216
217
218
219
220
221
222
# File 'lib/swagger/blocks.rb', line 215

def self.call(options = {}, &block)
  # Create a new instance and evaluate the block into it.
  instance = new
  instance.name = options[:name] if options[:name]
  instance.version = options[:version]
  instance.instance_eval(&block)
  instance
end