Class: Tabl::Column::FormatDsl

Inherits:
Object
  • Object
show all
Defined in:
lib/tabl/column.rb

Instance Method Summary collapse

Constructor Details

#initialize(column) ⇒ FormatDsl

Returns a new instance of FormatDsl.



45
46
47
# File 'lib/tabl/column.rb', line 45

def initialize(column)
  @column = column
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object



49
50
51
52
53
54
55
56
57
58
59
# File 'lib/tabl/column.rb', line 49

def method_missing(name, *args)
  name = name.to_s
  assign = (name =~ /=$/)
  key = name.gsub(/=$/, '').to_sym

  if (assign)
    @column.formats[key] = *args
  else
    @column.format(key, *args)
  end
end