Class: Typedocs::TypeSpec::Array
- Inherits:
-
Typedocs::TypeSpec
- Object
- Typedocs::TypeSpec
- Typedocs::TypeSpec::Array
- Defined in:
- lib/typedocs/type_spec.rb
Instance Method Summary collapse
-
#initialize(spec) ⇒ Array
constructor
A new instance of Array.
- #to_source ⇒ Object
- #valid?(obj) ⇒ Boolean
Methods inherited from Typedocs::TypeSpec
Constructor Details
#initialize(spec) ⇒ Array
Returns a new instance of Array.
120 121 122 123 |
# File 'lib/typedocs/type_spec.rb', line 120 def initialize(spec) Typedocs.ensure_klass(spec, Typedocs::TypeSpec) @spec = spec end |
Instance Method Details
#to_source ⇒ Object
127 128 129 |
# File 'lib/typedocs/type_spec.rb', line 127 def to_source "#{@spec.to_source}..." end |
#valid?(obj) ⇒ Boolean
124 125 126 |
# File 'lib/typedocs/type_spec.rb', line 124 def valid?(obj) obj.is_a?(::Array) && obj.all?{|elm| @spec.valid?(elm)} end |