Class: XLSSestavy::PromenneRadku
- Inherits:
-
Object
- Object
- XLSSestavy::PromenneRadku
- Defined in:
- lib/xls_sestavy/tabulky/promenne_radku.rb
Instance Attribute Summary collapse
-
#objekt ⇒ Object
readonly
Returns the value of attribute objekt.
-
#tabulka ⇒ Object
readonly
Returns the value of attribute tabulka.
Instance Method Summary collapse
- #[](klic) ⇒ Object
-
#initialize ⇒ PromenneRadku
constructor
A new instance of PromenneRadku.
- #nastav(klic, &block) ⇒ Object
- #pro_objekt(objekt) ⇒ Object
- #pro_tabulku(tabulka) ⇒ Object
Constructor Details
#initialize ⇒ PromenneRadku
Returns a new instance of PromenneRadku.
6 7 8 |
# File 'lib/xls_sestavy/tabulky/promenne_radku.rb', line 6 def initialize @metody = {} end |
Instance Attribute Details
#objekt ⇒ Object (readonly)
Returns the value of attribute objekt.
4 5 6 |
# File 'lib/xls_sestavy/tabulky/promenne_radku.rb', line 4 def objekt @objekt end |
#tabulka ⇒ Object (readonly)
Returns the value of attribute tabulka.
4 5 6 |
# File 'lib/xls_sestavy/tabulky/promenne_radku.rb', line 4 def tabulka @tabulka end |
Instance Method Details
#[](klic) ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/xls_sestavy/tabulky/promenne_radku.rb', line 26 def [](klic) h = @hodnoty[klic] unless h m = @metody[klic] h = m ? m.call(@objekt) : nil @hodnoty[klic] = h end h end |
#nastav(klic, &block) ⇒ Object
10 11 12 |
# File 'lib/xls_sestavy/tabulky/promenne_radku.rb', line 10 def nastav(klic, &block) @metody[klic] = block end |
#pro_objekt(objekt) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/xls_sestavy/tabulky/promenne_radku.rb', line 18 def pro_objekt(objekt) unless @objekt == objekt @hodnoty = {} @objekt = objekt end self end |
#pro_tabulku(tabulka) ⇒ Object
14 15 16 |
# File 'lib/xls_sestavy/tabulky/promenne_radku.rb', line 14 def pro_tabulku(tabulka) @tabulka = tabulka end |