Class: Transproc::Composer::Factory
- Inherits:
-
Object
- Object
- Transproc::Composer::Factory
- Defined in:
- lib/transproc/composer.rb
Instance Attribute Summary collapse
-
#default ⇒ Object
readonly
Returns the value of attribute default.
-
#fns ⇒ Object
readonly
Returns the value of attribute fns.
Instance Method Summary collapse
- #<<(other) ⇒ Object
-
#initialize(default = nil) ⇒ Factory
constructor
A new instance of Factory.
- #to_fn ⇒ Object
Constructor Details
#initialize(default = nil) ⇒ Factory
Returns a new instance of Factory.
7 8 9 10 |
# File 'lib/transproc/composer.rb', line 7 def initialize(default = nil) @fns = [] @default = default end |
Instance Attribute Details
#default ⇒ Object (readonly)
Returns the value of attribute default.
5 6 7 |
# File 'lib/transproc/composer.rb', line 5 def default @default end |
#fns ⇒ Object (readonly)
Returns the value of attribute fns.
5 6 7 |
# File 'lib/transproc/composer.rb', line 5 def fns @fns end |
Instance Method Details
#<<(other) ⇒ Object
12 13 14 15 |
# File 'lib/transproc/composer.rb', line 12 def <<(other) fns.concat(Array(other).compact) self end |
#to_fn ⇒ Object
17 18 19 |
# File 'lib/transproc/composer.rb', line 17 def to_fn fns.reduce(:+) || default end |