Class: Uniword::Properties::Tabs

Inherits:
Lutaml::Model::Serializable
  • Object
show all
Defined in:
lib/uniword/properties/tabs.rb

Overview

Tab stops collection

Represents <w:tabs> element containing multiple tab stop definitions.

Examples:

Creating tab stops

tabs = Tabs.new(
  tab_stops: [
    TabStop.new(alignment: 'left', position: 720),
    TabStop.new(alignment: 'center', position: 1440),
    TabStop.new(alignment: 'right', position: 2160)
  ]
)

Instance Method Summary collapse

Instance Method Details

#<<(tab_stop) ⇒ Object

Delegate array operations to tab_stops



31
32
33
# File 'lib/uniword/properties/tabs.rb', line 31

def <<(tab_stop)
  tab_stops << tab_stop
end

#[](index) ⇒ Object



47
48
49
# File 'lib/uniword/properties/tabs.rb', line 47

def [](index)
  tab_stops[index]
end

#eachObject



51
52
53
# File 'lib/uniword/properties/tabs.rb', line 51

def each(&)
  tab_stops.each(&)
end

#empty?Boolean

Returns:

  • (Boolean)


59
60
61
# File 'lib/uniword/properties/tabs.rb', line 59

def empty?
  tab_stops.empty?
end

#firstObject



39
40
41
# File 'lib/uniword/properties/tabs.rb', line 39

def first
  tab_stops.first
end

#lastObject



43
44
45
# File 'lib/uniword/properties/tabs.rb', line 43

def last
  tab_stops.last
end

#mapObject



55
56
57
# File 'lib/uniword/properties/tabs.rb', line 55

def map(&)
  tab_stops.map(&)
end

#sizeObject



35
36
37
# File 'lib/uniword/properties/tabs.rb', line 35

def size
  tab_stops.size
end