Class: XLSSestavy::Tabulka

Inherits:
Object
  • Object
show all
Defined in:
lib/xls_sestavy/tabulky/tabulka.rb

Direct Known Subclasses

Xls::TabulkaXls

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(sestava, args = {}) {|_self| ... } ⇒ Tabulka

Returns a new instance of Tabulka.

Yields:

  • (_self)

Yield Parameters:



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/xls_sestavy/tabulky/tabulka.rb', line 7

def initialize(sestava, args={}, &block)
  @sestava = sestava
  @args = args

  @sloupce = args[:sloupce] || []
  @promenne = args[:promenne]

  yield self if block_given?

  @sloupce.each{|s| s.tabulka = self}
  @promenne.pro_tabulku self if @promenne
end

Instance Attribute Details

#promenneObject (readonly)

Returns the value of attribute promenne.



5
6
7
# File 'lib/xls_sestavy/tabulky/tabulka.rb', line 5

def promenne
  @promenne
end

#sestavaObject (readonly)

Returns the value of attribute sestava.



5
6
7
# File 'lib/xls_sestavy/tabulky/tabulka.rb', line 5

def sestava
  @sestava
end

Instance Method Details

#promenna(klic, &block) ⇒ Object



30
31
32
33
# File 'lib/xls_sestavy/tabulky/tabulka.rb', line 30

def promenna(klic, &block)
  @promenne ||= PromenneRadku.new
  @promenne.nastav klic, &block
end

#sloupec(*args, &block) ⇒ Object



20
21
22
23
24
25
26
27
28
# File 'lib/xls_sestavy/tabulky/tabulka.rb', line 20

def sloupec(*args, &block)
  s = if args.first.is_a? Sloupec
    args.first
  else
    Sloupec.new(*args, &block)
  end
  s.tabulka = self
  @sloupce << s
end