Sha256: f01ba3594fdf0ec7a3787ce60658da2267c1880508b3e322e793482554f110a2
Contents?: true
Size: 706 Bytes
Versions: 17
Compression:
Stored size: 706 Bytes
Contents
require 'hashie' module Raven INTERFACES = {} class Interface < Hashie::Dash def initialize(attributes={}, &block) @check_required = false super(attributes) block.call(self) if block @check_required = true assert_required_properties_set! end def assert_required_properties_set! super if @check_required end def self.name(value=nil) @interface_name = value if value @interface_name end end def self.register_interface(mapping) mapping.each_pair do |key, klass| INTERFACES[key.to_s] = klass INTERFACES[klass.name] = klass end end def self.find_interface(name) INTERFACES[name.to_s] end end
Version data entries
17 entries across 17 versions & 1 rubygems