class Flipper::Types::Actor

Attributes

thing[R]

Public Class Methods

new(thing) click to toggle source
# File lib/flipper/types/actor.rb, line 11
def initialize(thing)
  raise ArgumentError, 'thing cannot be nil' if thing.nil?

  unless thing.respond_to?(:flipper_id)
    raise ArgumentError, "#{thing.inspect} must respond to flipper_id, but does not"
  end

  @thing = thing
  @value = thing.flipper_id.to_s
end
wrappable?(thing) click to toggle source
# File lib/flipper/types/actor.rb, line 4
def self.wrappable?(thing)
  return false if thing.nil?
  thing.respond_to?(:flipper_id)
end

Public Instance Methods

method_missing(name, *args, &block) click to toggle source
# File lib/flipper/types/actor.rb, line 26
def method_missing(name, *args, &block)
  @thing.send name, *args, &block
end
respond_to?(*args) click to toggle source
Calls superclass method
# File lib/flipper/types/actor.rb, line 22
def respond_to?(*args)
  super || @thing.respond_to?(*args)
end