Class: XLSSestavy::ArgumentySestavy

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ ArgumentySestavy

Returns a new instance of ArgumentySestavy.



9
10
11
# File 'lib/xls_sestavy/argumenty_sestavy.rb', line 9

def initialize(args={})
  args.each_pair{|k, v| send "#{k}=", v }
end

Instance Attribute Details

#do_dataObject

Returns the value of attribute do_data.



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

def do_data
  @do_data
end

#od_dataObject Also known as: k_datu

Returns the value of attribute od_data.



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

def od_data
  @od_data
end

#uzivatel_idObject

Returns the value of attribute uzivatel_id.



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

def uzivatel_id
  @uzivatel_id
end

Instance Method Details

#argumenty_sloupce(arr) ⇒ Object



17
18
19
# File 'lib/xls_sestavy/argumenty_sestavy.rb', line 17

def argumenty_sloupce(arr)
  arr.map{|a| (a.class==Symbol && respond_to?(a)) ? send(a) : a}
end

#jeden_datum?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/xls_sestavy/argumenty_sestavy.rb', line 13

def jeden_datum?
  @od_data==@do_data
end

#k_datu=(datum) ⇒ Object



7
# File 'lib/xls_sestavy/argumenty_sestavy.rb', line 7

def k_datu=(datum); @od_data = datum; @do_data = datum; end

#to_sObject



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

def to_s
  return @to_s if defined? @to_s
  @to_s = if jeden_datum?
            "#{I18n.l(@od_data, format: :excel)[0..-2]}"
          else
            "#{I18n.l(@od_data, format: :excel)[0..-2]}_#{I18n.l(@do_data, format: :excel)[0..-2]}"
          end
end