Class: Osb::Internal::TypedArray Private
- Inherits:
-
Object
- Object
- Osb::Internal::TypedArray
- Defined in:
- lib/osb/assert.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
-
#initialize(type) ⇒ TypedArray
constructor
private
A new instance of TypedArray.
- #name ⇒ Object private
- #valid?(object) ⇒ Boolean private
Constructor Details
#initialize(type) ⇒ TypedArray
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of TypedArray.
20 21 22 |
# File 'lib/osb/assert.rb', line 20 def initialize(type) @type = type end |
Instance Method Details
#name ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
24 25 26 |
# File 'lib/osb/assert.rb', line 24 def name "Array<#{@type.name}>" end |
#valid?(object) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
28 29 30 |
# File 'lib/osb/assert.rb', line 28 def valid?(object) object.is_a?(Array) && object.all? { |value| value.is_a?(@type) } end |