Class: DavinciRubyClientSDK::Blueprint
- Inherits:
-
Object
- Object
- DavinciRubyClientSDK::Blueprint
- Defined in:
- lib/DavinciRubyClientSDK/blueprint.rb
Instance Attribute Summary collapse
-
#layers ⇒ Object
Returns the value of attribute layers.
-
#tag ⇒ Object
Returns the value of attribute tag.
-
#tmp_inspiration ⇒ Object
Returns the value of attribute tmp_inspiration.
-
#tmp_layer ⇒ Object
Returns the value of attribute tmp_layer.
Instance Method Summary collapse
- #add_canvas_option(key, value) ⇒ Object
- #add_inspiration(key, value) ⇒ Object
- #add_layer(index) {|_self| ... } ⇒ Object
- #add_mount_option(key, value) ⇒ Object
- #canvas {|_self| ... } ⇒ Object
-
#initialize(tag) ⇒ Blueprint
constructor
A new instance of Blueprint.
- #inspiration=(value = {}) ⇒ Object
- #mount {|_self| ... } ⇒ Object
- #technique=(value) ⇒ Object
- #to_blueprint ⇒ Object
Constructor Details
permalink #initialize(tag) ⇒ Blueprint
Returns a new instance of Blueprint.
6 7 8 9 10 |
# File 'lib/DavinciRubyClientSDK/blueprint.rb', line 6 def initialize(tag) @blueprint = Hash.new @layers = Array.new self.tag = tag end |
Instance Attribute Details
permalink #layers ⇒ Object
Returns the value of attribute layers.
4 5 6 |
# File 'lib/DavinciRubyClientSDK/blueprint.rb', line 4 def layers @layers end |
permalink #tag ⇒ Object
Returns the value of attribute tag.
4 5 6 |
# File 'lib/DavinciRubyClientSDK/blueprint.rb', line 4 def tag @tag end |
permalink #tmp_inspiration ⇒ Object
Returns the value of attribute tmp_inspiration.
4 5 6 |
# File 'lib/DavinciRubyClientSDK/blueprint.rb', line 4 def tmp_inspiration @tmp_inspiration end |
permalink #tmp_layer ⇒ Object
Returns the value of attribute tmp_layer.
4 5 6 |
# File 'lib/DavinciRubyClientSDK/blueprint.rb', line 4 def tmp_layer @tmp_layer end |
Instance Method Details
permalink #add_canvas_option(key, value) ⇒ Object
[View source]
33 34 35 |
# File 'lib/DavinciRubyClientSDK/blueprint.rb', line 33 def add_canvas_option(key, value) @canvas[key.to_sym] = value end |
permalink #add_inspiration(key, value) ⇒ Object
[View source]
55 56 57 |
# File 'lib/DavinciRubyClientSDK/blueprint.rb', line 55 def add_inspiration(key, value) self.tmp_inspiration[key.to_sym] = value end |
permalink #add_layer(index) {|_self| ... } ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/DavinciRubyClientSDK/blueprint.rb', line 12 def add_layer(index) self.tmp_layer = Hash.new self.tmp_inspiration = Hash.new self.tmp_layer[:layer] = index yield self if block_given? self.tmp_layer[:inspiration] = self.tmp_inspiration @layers << self.tmp_layer self.tmp_layer = nil self.tmp_inspiration = nil end |
permalink #add_mount_option(key, value) ⇒ Object
[View source]
43 44 45 |
# File 'lib/DavinciRubyClientSDK/blueprint.rb', line 43 def add_mount_option(key, value) @mount[key.to_sym] = value end |
permalink #canvas {|_self| ... } ⇒ Object
27 28 29 30 31 |
# File 'lib/DavinciRubyClientSDK/blueprint.rb', line 27 def canvas @canvas ||= Hash.new yield self if block_given? @canvas end |
permalink #inspiration=(value = {}) ⇒ Object
[View source]
51 52 53 |
# File 'lib/DavinciRubyClientSDK/blueprint.rb', line 51 def inspiration=(value = {}) self.tmp_inspiration = value end |
permalink #mount {|_self| ... } ⇒ Object
37 38 39 40 41 |
# File 'lib/DavinciRubyClientSDK/blueprint.rb', line 37 def mount @mount ||= Hash.new yield self if block_given? @mount end |
permalink #technique=(value) ⇒ Object
[View source]
47 48 49 |
# File 'lib/DavinciRubyClientSDK/blueprint.rb', line 47 def technique=(value) self.tmp_layer[:technique] = value.to_s end |
permalink #to_blueprint ⇒ Object
[View source]
59 60 61 62 63 64 65 66 |
# File 'lib/DavinciRubyClientSDK/blueprint.rb', line 59 def to_blueprint { :tag => @tag, :layers => @layers, :canvas => @canvas, :mount => @mount } end |