Module: Domain::Factory
- Included in:
- Domain
- Defined in:
- lib/domain/factory.rb
Instance Method Summary collapse
-
#sbyc(super_domain = Object, &pred) ⇒ Class
Creates a domain through specialization by constraint.
-
#scalar(*component_names) ⇒ Class
Factors a scalar domain.
-
#union(*sub_domains) ⇒ Class
Factors a union domain.
Instance Method Details
#sbyc(super_domain = Object, &pred) ⇒ Class
Creates a domain through specialization by constraint
19 20 21 |
# File 'lib/domain/factory.rb', line 19 def sbyc(super_domain = Object, &pred) Class.new(super_domain){ extend SByC.new(super_domain, pred) } end |
#scalar(*component_names) ⇒ Class
Factors a scalar domain
47 48 49 |
# File 'lib/domain/factory.rb', line 47 def scalar(*component_names) Class.new{ extend Scalar.new(*component_names) } end |
#union(*sub_domains) ⇒ Class
Factors a union domain
34 35 36 |
# File 'lib/domain/factory.rb', line 34 def union(*sub_domains) Class.new{ extend Union.new(*sub_domains) } end |