Class: T::Types::TypedEnumerator
- Inherits:
-
TypedEnumerable
- Object
- Base
- TypedEnumerable
- T::Types::TypedEnumerator
- Defined in:
- lib/types/types/typed_enumerator.rb
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #name ⇒ Object
-
#new(*args, &blk) ⇒ Object
rubocop:disable PrisonGuard/BanBuiltinMethodOverride.
- #valid?(obj) ⇒ Boolean
Methods inherited from TypedEnumerable
Methods inherited from Base
#==, #describe_obj, #error_message_for_obj, #hash, method_added, #subtype_of?, #to_s, #validate!
Constructor Details
This class inherits a constructor from T::Types::TypedEnumerable
Instance Attribute Details
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/types/types/typed_enumerator.rb', line 6 def type @type end |
Instance Method Details
#name ⇒ Object
9 10 11 |
# File 'lib/types/types/typed_enumerator.rb', line 9 def name "T::Enumerator[#{@type.name}]" end |
#new(*args, &blk) ⇒ Object
rubocop:disable PrisonGuard/BanBuiltinMethodOverride
18 19 20 |
# File 'lib/types/types/typed_enumerator.rb', line 18 def new(*args, &blk) # rubocop:disable PrisonGuard/BanBuiltinMethodOverride T.unsafe(Enumerator).new(*args, &blk) end |
#valid?(obj) ⇒ Boolean
14 15 16 |
# File 'lib/types/types/typed_enumerator.rb', line 14 def valid?(obj) obj.is_a?(Enumerator) && super end |