Sha256: 4cc2298f65eeb2732c854f3e19b1f5e79e925305cd8d311f949320aa257ad14e

Contents?: true

Size: 1.12 KB

Versions: 34

Compression:

Stored size: 1.12 KB

Contents

class TableSettings
  class DetailTable
    attr_reader :hash

    def initialize
      @hash = {
          :only => [],
          :except => [],
          :global_format_method => {},
          :show_timestamps => false,
          :show_id => false
              }
    end

    def hash
      @hash.delete(:only) if @hash[:only].empty?
      @hash.delete(:except) if @hash[:except].empty?

      @hash
    end

    def add(column)
      @hash[:only] << column
      self
    end

    def exclude(column)
      @hash[:except] << column
      self
    end

    def show_timestamps(boolean)
      @hash[:show_timestamps] = boolean
      self
    end

    def show_id(boolean)
      @hash[:show_id] = boolean
      self
    end

    def class_name(name)
      @hash[:class_name] = name
      self
    end

    def caption(name)
      @hash[:caption] = caption
      self
    end

    def global_format_method(col_name, fnc_name)
      @hash[:global_format_method][:col_name] = fnc_name
      self
    end

    def css_id(id)
      @hash[:id] = id
      self
    end
    def css_class(name)
      @hash[:class] = name
      self
    end

  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
it-logica-application-backbone-1.0.38 lib/table_settings/detail_table.rb
it-logica-application-backbone-1.0.37 lib/table_settings/detail_table.rb
it-logica-application-backbone-1.0.36 lib/table_settings/detail_table.rb
it-logica-application-backbone-1.0.35 lib/table_settings/detail_table.rb
it-logica-application-backbone-1.0.34 lib/table_settings/detail_table.rb
it-logica-application-backbone-1.0.33 lib/table_settings/detail_table.rb
it-logica-application-backbone-1.0.32 lib/table_settings/detail_table.rb
it-logica-application-backbone-1.0.31 lib/table_settings/detail_table.rb
it-logica-application-backbone-1.0.30 lib/table_settings/detail_table.rb
it-logica-application-backbone-1.0.29 lib/table_settings/detail_table.rb
it-logica-application-backbone-1.0.28 lib/table_settings/detail_table.rb
it-logica-application-backbone-1.0.27 lib/table_settings/detail_table.rb
it-logica-application-backbone-1.0.26 lib/table_settings/detail_table.rb
it-logica-application-backbone-1.0.25 lib/table_settings/detail_table.rb
it-logica-application-backbone-1.0.24 lib/table_settings/detail_table.rb
it-logica-application-backbone-1.0.23 lib/table_settings/detail_table.rb
it-logica-application-backbone-1.0.22 lib/table_settings/detail_table.rb
it-logica-application-backbone-1.0.21 lib/table_settings/detail_table.rb
it-logica-application-backbone-1.0.20 lib/table_settings/detail_table.rb
it-logica-application-backbone-1.0.19 lib/table_settings/detail_table.rb