Class: Media::Filter::Graph
- Inherits:
-
Object
- Object
- Media::Filter::Graph
- Defined in:
- lib/media/filter/graph.rb
Instance Attribute Summary collapse
-
#chains ⇒ Object
readonly
Returns the value of attribute chains.
Instance Method Summary collapse
- #add_chain(&block) ⇒ Object (also: #chain)
-
#initialize(args = {}, &block) ⇒ Graph
constructor
A new instance of Graph.
- #to_s ⇒ Object
Constructor Details
#initialize(args = {}, &block) ⇒ Graph
Returns a new instance of Graph.
8 9 10 11 12 |
# File 'lib/media/filter/graph.rb', line 8 def initialize(args={}, &block) @chains = args.fetch(:chains, []) block.arity < 1 ? instance_eval(&block) : block.call(self) if block_given? end |
Instance Attribute Details
#chains ⇒ Object (readonly)
Returns the value of attribute chains.
6 7 8 |
# File 'lib/media/filter/graph.rb', line 6 def chains @chains end |
Instance Method Details
#add_chain(&block) ⇒ Object Also known as: chain
18 19 20 |
# File 'lib/media/filter/graph.rb', line 18 def add_chain(&block) @chains << Filter::Chain.new(&block) end |
#to_s ⇒ Object
14 15 16 |
# File 'lib/media/filter/graph.rb', line 14 def to_s chains.join('; ') end |