Class: Smoke::Join
Overview
Instance Attribute Summary
Attributes inherited from Origin
#exposed, #items, #requirements
Instance Method Summary collapse
-
#initialize(names, &block) ⇒ Join
constructor
:nodoc:.
- #method_missing(symbol, *args, &block) ⇒ Object
-
#name(rename = nil) ⇒ Object
Rename sources immediately after they’ve been joined together Usage: Smoke.join(:delicious, :twitter, :flickr) do name :web_stream end.
Methods inherited from Origin
#conceal, #concealed?, #discard, #emit, #expose, #exposed?, #insert, #keep, #output, #path, #prepare, #rename, #reverse, #sort, #transform, #truncate
Constructor Details
#initialize(names, &block) ⇒ Join
:nodoc:
11 12 13 14 |
# File 'lib/smoke/source/join.rb', line 11 def initialize(names, &block) @names = names super((names << "joined").join("_").to_sym, &block) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(symbol, *args, &block) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/smoke/source/join.rb', line 26 def method_missing(symbol, *args, &block) ivar = "@#{symbol}" unless args.empty? sources.each do |source| source.last.instance_variable_set(ivar, args.last) end end return self end |