Sha256: edeb94e755f6383a4535bc771a0d43947ee2c61072be6c2d5e56c3fe421718ce
Contents?: true
Size: 741 Bytes
Versions: 15
Compression:
Stored size: 741 Bytes
Contents
module Flipper module Types class Actor < Type def self.wrappable?(thing) return false if thing.nil? thing.respond_to?(:flipper_id) end attr_reader :thing def initialize(thing) if thing.nil? raise ArgumentError.new("thing cannot be nil") end unless thing.respond_to?(:flipper_id) raise ArgumentError.new("#{thing.inspect} must respond to flipper_id, but does not") end @thing = thing @value = thing.flipper_id.to_s end def respond_to?(*args) super || @thing.respond_to?(*args) end def method_missing(name, *args, &block) @thing.send name, *args, &block end end end end
Version data entries
15 entries across 15 versions & 1 rubygems