Class: Finitio::Compilation
- Inherits:
-
Object
- Object
- Finitio::Compilation
- Defined in:
- lib/finitio/support/compilation.rb
Instance Attribute Summary collapse
-
#factory ⇒ Object
readonly
Returns the value of attribute factory.
-
#proxies ⇒ Object
readonly
Returns the value of attribute proxies.
-
#system ⇒ Object
readonly
Returns the value of attribute system.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(system = System.new, factory = TypeFactory.new) ⇒ Compilation
constructor
A new instance of Compilation.
- #proxy(*args, &bl) ⇒ Object
- #resolve_proxies! ⇒ Object
Constructor Details
#initialize(system = System.new, factory = TypeFactory.new) ⇒ Compilation
Returns a new instance of Compilation.
4 5 6 7 8 |
# File 'lib/finitio/support/compilation.rb', line 4 def initialize(system = System.new, factory = TypeFactory.new) @system = system @factory = factory @proxies = [] end |
Instance Attribute Details
#factory ⇒ Object (readonly)
Returns the value of attribute factory.
9 10 11 |
# File 'lib/finitio/support/compilation.rb', line 9 def factory @factory end |
#proxies ⇒ Object (readonly)
Returns the value of attribute proxies.
9 10 11 |
# File 'lib/finitio/support/compilation.rb', line 9 def proxies @proxies end |
#system ⇒ Object (readonly)
Returns the value of attribute system.
9 10 11 |
# File 'lib/finitio/support/compilation.rb', line 9 def system @system end |
Class Method Details
.coerce(arg) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/finitio/support/compilation.rb', line 11 def self.coerce(arg) case arg when NilClass then new when System then new(arg, arg.factory) when TypeFactory then new(System.new, arg) else raise ArgumentError, "Unable to coerce `#{arg}`" end end |
Instance Method Details
#proxy(*args, &bl) ⇒ Object
36 37 38 39 40 |
# File 'lib/finitio/support/compilation.rb', line 36 def proxy(*args, &bl) proxy = factory.proxy(*args, &bl) proxies << proxy proxy end |
#resolve_proxies! ⇒ Object
21 22 23 24 25 26 |
# File 'lib/finitio/support/compilation.rb', line 21 def resolve_proxies! proxies.each do |p| p.resolve(system) end self end |