Class: OpenXml::Docx::Properties::Tab

Inherits:
BaseProperty show all
Defined in:
lib/openxml/docx/properties/tab.rb

Constant Summary collapse

VALID_TYPES =
%i(bar center clear decimal end num start left right)
VALID_LEADERS =
[nil, :dot, :heavy, :hyphen, :middleDot, :none, :underscore]

Instance Attribute Summary collapse

Attributes inherited from BaseProperty

#value

Instance Method Summary collapse

Methods inherited from BaseProperty

#default_name, #default_namespace, #default_tag, name, #name, #namespace, namespace, #render?, #tag, tag, tag_is_one_of

Constructor Details

#initialize(position, type, leader = nil) ⇒ Tab

Returns a new instance of Tab.


10
11
12
13
14
# File 'lib/openxml/docx/properties/tab.rb', line 10

def initialize(position, type, leader=nil)
  self.position = position
  self.type = type
  self.leader = leader
end

Instance Attribute Details

#leaderObject

Returns the value of attribute leader


5
6
7
# File 'lib/openxml/docx/properties/tab.rb', line 5

def leader
  @leader
end

#positionObject

Returns the value of attribute position


5
6
7
# File 'lib/openxml/docx/properties/tab.rb', line 5

def position
  @position
end

#typeObject

Returns the value of attribute type


5
6
7
# File 'lib/openxml/docx/properties/tab.rb', line 5

def type
  @type
end

Instance Method Details

#to_xml(xml) ⇒ Object


31
32
33
# File 'lib/openxml/docx/properties/tab.rb', line 31

def to_xml(xml)
  xml["w"].public_send(tag, xml_attributes)
end