Class: Axlsx::PictureLocking

Inherits:
Object
  • Object
show all
Defined in:
lib/axlsx/drawing/picture_locking.rb

Overview

The picture locking class defines the locking properties for pictures in your workbook.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ PictureLocking

Creates a new PictureLocking object

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • noGrp (Boolean)
  • noSelect (Boolean)
  • noRot (Boolean)
  • noChangeAspect (Boolean)
  • noMove (Boolean)
  • noResize (Boolean)
  • noEditPoints (Boolean)
  • noAdjustHandles (Boolean)
  • noChangeArrowheads (Boolean)
  • noChangeShapeType (Boolean)


29
30
31
32
33
34
# File 'lib/axlsx/drawing/picture_locking.rb', line 29

def initialize(options={})
  @noChangeAspect = true
  options.each do |o|
    self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
  end
end

Instance Attribute Details

#noAdjustHandlesObject

Returns the value of attribute noAdjustHandles.



14
15
16
# File 'lib/axlsx/drawing/picture_locking.rb', line 14

def noAdjustHandles
  @noAdjustHandles
end

#noChangeArrowheadsObject

Returns the value of attribute noChangeArrowheads.



15
16
17
# File 'lib/axlsx/drawing/picture_locking.rb', line 15

def noChangeArrowheads
  @noChangeArrowheads
end

#noChangeAspectObject

Returns the value of attribute noChangeAspect.



10
11
12
# File 'lib/axlsx/drawing/picture_locking.rb', line 10

def noChangeAspect
  @noChangeAspect
end

#noChangeShapeTypeObject

Returns the value of attribute noChangeShapeType.



16
17
18
# File 'lib/axlsx/drawing/picture_locking.rb', line 16

def noChangeShapeType
  @noChangeShapeType
end

#noEditPointsObject

Returns the value of attribute noEditPoints.



13
14
15
# File 'lib/axlsx/drawing/picture_locking.rb', line 13

def noEditPoints
  @noEditPoints
end

#noGrpObject

Returns the value of attribute noGrp.



7
8
9
# File 'lib/axlsx/drawing/picture_locking.rb', line 7

def noGrp
  @noGrp
end

#noMoveObject

Returns the value of attribute noMove.



11
12
13
# File 'lib/axlsx/drawing/picture_locking.rb', line 11

def noMove
  @noMove
end

#noResizeObject

Returns the value of attribute noResize.



12
13
14
# File 'lib/axlsx/drawing/picture_locking.rb', line 12

def noResize
  @noResize
end

#noRotObject

Returns the value of attribute noRot.



9
10
11
# File 'lib/axlsx/drawing/picture_locking.rb', line 9

def noRot
  @noRot
end

#noSelectObject

Returns the value of attribute noSelect.



8
9
10
# File 'lib/axlsx/drawing/picture_locking.rb', line 8

def noSelect
  @noSelect
end

Instance Method Details

#to_xml_string(str = '') ⇒ String

Serializes the object

Parameters:

  • str (String) (defaults to: '')

Returns:

  • (String)


69
70
71
72
73
# File 'lib/axlsx/drawing/picture_locking.rb', line 69

def to_xml_string(str = '')
  str << '<a:picLocks '
  str << instance_values.map { |key, value| '' << key.to_s << '="' << value.to_s << '"' }.join(' ')
  str << '/>'
end