Class: Kind::Any
- Inherits:
-
Object
- Object
- Kind::Any
- Defined in:
- lib/kind/any.rb
Instance Attribute Summary collapse
-
#values ⇒ Object
readonly
Returns the value of attribute values.
Instance Method Summary collapse
- #===(value) ⇒ Object
- #[](value, label: nil) ⇒ Object
-
#initialize(*args) ⇒ Any
constructor
A new instance of Any.
- #name ⇒ Object (also: #inspect)
- #|(another_kind) ⇒ Object
Constructor Details
Instance Attribute Details
#values ⇒ Object (readonly)
Returns the value of attribute values.
9 10 11 |
# File 'lib/kind/any.rb', line 9 def values @values end |
Instance Method Details
#===(value) ⇒ Object
17 18 19 |
# File 'lib/kind/any.rb', line 17 def ===(value) @values.include?(value) end |
#[](value, label: nil) ⇒ Object
21 22 23 |
# File 'lib/kind/any.rb', line 21 def [](value, label: nil) STRICT.object_is_a(self, value, label) end |
#name ⇒ Object Also known as: inspect
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/kind/any.rb', line 29 def name str = @values.inspect if @values.is_a?(::Set) str.sub!(/\A#<Set: /, '') str.chomp!('>') end "Kind::Any#{str}" end |