Class: Kind::RespondTo
- Inherits:
-
Object
- Object
- Kind::RespondTo
- Includes:
- BasicObject
- Defined in:
- lib/kind/objects/respond_to.rb
Instance Attribute Summary collapse
-
#inspect ⇒ Object
(also: #name)
readonly
Returns the value of attribute inspect.
Class Method Summary collapse
Instance Method Summary collapse
- #===(value) ⇒ Object (also: #call)
-
#initialize(method_names) ⇒ RespondTo
constructor
A new instance of RespondTo.
Methods included from BasicObject
#[], #or, #or_nil, #or_null, #or_undefined, #value, #value?
Constructor Details
#initialize(method_names) ⇒ RespondTo
Returns a new instance of RespondTo.
17 18 19 20 |
# File 'lib/kind/objects/respond_to.rb', line 17 def initialize(method_names) @method_names = method_names @inspect = "Kind::RespondTo#{@method_names}" end |
Instance Attribute Details
#inspect ⇒ Object (readonly) Also known as: name
Returns the value of attribute inspect.
15 16 17 |
# File 'lib/kind/objects/respond_to.rb', line 15 def inspect @inspect end |
Class Method Details
.[](*args) ⇒ Object
7 8 9 10 11 |
# File 'lib/kind/objects/respond_to.rb', line 7 def self.[](*args) args.each { |arg| STRICT.kind_of(::Symbol, arg) } new(args) end |
Instance Method Details
#===(value) ⇒ Object Also known as: call
22 23 24 |
# File 'lib/kind/objects/respond_to.rb', line 22 def ===(value) KIND.interface?(@method_names, value) end |