Class: Type::Definition::Proxy Private
- Inherits:
-
Object
- Object
- Type::Definition::Proxy
- Defined in:
- lib/type/definition/proxy.rb
Overview
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.
The Proxy is an in-progress definition, a convenience object to support the declaration syntax.
Instance Method Summary collapse
- #from(parent, &config) ⇒ Object private
-
#initialize(name, klass) ⇒ Proxy
constructor
private
A new instance of Proxy.
Constructor Details
#initialize(name, klass) ⇒ Proxy
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 Proxy.
9 10 11 12 |
# File 'lib/type/definition/proxy.rb', line 9 def initialize(name, klass) @name = name @klass = klass end |
Instance Method Details
#from(parent, &config) ⇒ 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.
15 16 17 18 19 20 21 |
# File 'lib/type/definition/proxy.rb', line 15 def from(parent, &config) raise ArgumentError, 'Block Required!' unless block_given? Type[parent].tap do |resolved_parent| raise ArgumentError unless resolved_parent.kind_of?(@klass) end.refine(@name, &config) end |