Sha256: 96396c01cfbc0010c9d2dc48ab50d966e1fc46005df75b2b9d4f705bcc1ed725
Contents?: true
Size: 852 Bytes
Versions: 30
Compression:
Stored size: 852 Bytes
Contents
module Seahorse module Model class Api def initialize @metadata = {} @operations = {} end # @return [String, nil] attr_accessor :version # @return [Hash] attr_accessor :metadata def operations(&block) if block_given? @operations.each(&block) else @operations.enum_for(:each) end end def operation(name) if @operations.key?(name.to_sym) @operations[name.to_sym] else raise ArgumentError, "unknown operation #{name.inspect}" end end def operation_names @operations.keys end def add_operation(name, operation) @operations[name.to_sym] = operation end def inspect(*args) "#<#{self.class.name}>" end end end end
Version data entries
30 entries across 30 versions & 1 rubygems