Class: DavinciRubyClientSDK::Blueprint

Inherits:
Object
  • Object
show all
Defined in:
lib/DavinciRubyClientSDK/blueprint.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tag) ⇒ Blueprint

Returns a new instance of Blueprint.

[View source]

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

#layersObject

Returns the value of attribute layers.


4
5
6
# File 'lib/DavinciRubyClientSDK/blueprint.rb', line 4

def layers
  @layers
end

#tagObject

Returns the value of attribute tag.


4
5
6
# File 'lib/DavinciRubyClientSDK/blueprint.rb', line 4

def tag
  @tag
end

#tmp_inspirationObject

Returns the value of attribute tmp_inspiration.


4
5
6
# File 'lib/DavinciRubyClientSDK/blueprint.rb', line 4

def tmp_inspiration
  @tmp_inspiration
end

#tmp_layerObject

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

#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

#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

#add_layer(index) {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

[View source]

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

#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

#canvas {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

[View source]

27
28
29
30
31
# File 'lib/DavinciRubyClientSDK/blueprint.rb', line 27

def canvas
  @canvas ||= Hash.new
  yield self if block_given?
  @canvas
end

#inspiration=(value = {}) ⇒ Object

[View source]

51
52
53
# File 'lib/DavinciRubyClientSDK/blueprint.rb', line 51

def inspiration=(value = {})
  self.tmp_inspiration = value
end

#mount {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

[View source]

37
38
39
40
41
# File 'lib/DavinciRubyClientSDK/blueprint.rb', line 37

def mount
  @mount ||= Hash.new
  yield self if block_given?
  @mount
end

#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

#to_blueprintObject

[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