Class: Nanoc::Core::ContractsSupport::EnabledContracts::Named
- Inherits:
-
AbstractContract
- Object
- AbstractContract
- Nanoc::Core::ContractsSupport::EnabledContracts::Named
- Defined in:
- lib/nanoc/core/contracts_support.rb
Instance Method Summary collapse
-
#initialize(name) ⇒ Named
constructor
A new instance of Named.
- #inspect ⇒ Object
- #valid?(val) ⇒ Boolean
Methods inherited from AbstractContract
Constructor Details
#initialize(name) ⇒ Named
Returns a new instance of Named.
48 49 50 |
# File 'lib/nanoc/core/contracts_support.rb', line 48 def initialize(name) @name = name end |
Instance Method Details
#inspect ⇒ Object
56 57 58 |
# File 'lib/nanoc/core/contracts_support.rb', line 56 def inspect "#{self.class}(#{@name})" end |
#valid?(val) ⇒ Boolean
52 53 54 |
# File 'lib/nanoc/core/contracts_support.rb', line 52 def valid?(val) val.is_a?(Kernel.const_get(@name)) end |