Class: Nanoc::Core::ContractsSupport::EnabledContracts::IterOf
- Inherits:
-
AbstractContract
- Object
- AbstractContract
- Nanoc::Core::ContractsSupport::EnabledContracts::IterOf
- Defined in:
- lib/nanoc/core/contracts_support.rb
Instance Method Summary collapse
-
#initialize(contract) ⇒ IterOf
constructor
A new instance of IterOf.
- #inspect ⇒ Object
- #valid?(val) ⇒ Boolean
Methods inherited from AbstractContract
Constructor Details
#initialize(contract) ⇒ IterOf
Returns a new instance of IterOf.
62 63 64 |
# File 'lib/nanoc/core/contracts_support.rb', line 62 def initialize(contract) @contract = contract end |
Instance Method Details
#inspect ⇒ Object
70 71 72 |
# File 'lib/nanoc/core/contracts_support.rb', line 70 def inspect "#{self.class}(#{@contract})" end |
#valid?(val) ⇒ Boolean
66 67 68 |
# File 'lib/nanoc/core/contracts_support.rb', line 66 def valid?(val) val.respond_to?(:each) && val.all? { |v| Contract.valid?(v, @contract) } end |