Sha256: 9b76382437777d83224df4adf6d538879cbde00dc6f6e76bb0e862801fd3a881

Contents?: true

Size: 1.12 KB

Versions: 80

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

80 entries across 80 versions & 1 rubygems

Version Path
it-logica-application-backbone-1.2.12 lib/table_settings/detail_table.rb
it-logica-application-backbone-1.2.11 lib/table_settings/detail_table.rb
it-logica-application-backbone-1.2.10 lib/table_settings/detail_table.rb
it-logica-application-backbone-1.2.9 lib/table_settings/detail_table.rb
it-logica-application-backbone-1.2.8 lib/table_settings/detail_table.rb
it-logica-application-backbone-1.2.7 lib/table_settings/detail_table.rb
it-logica-application-backbone-1.2.6 lib/table_settings/detail_table.rb
it-logica-application-backbone-1.2.5 lib/table_settings/detail_table.rb
it-logica-application-backbone-1.2.4 lib/table_settings/detail_table.rb
it-logica-application-backbone-1.2.3 lib/table_settings/detail_table.rb
it-logica-application-backbone-1.2.2 lib/table_settings/detail_table.rb
it-logica-application-backbone-1.2.1 lib/table_settings/detail_table.rb
it-logica-application-backbone-1.2.0 lib/table_settings/detail_table.rb
it-logica-application-backbone-1.1.8 lib/table_settings/detail_table.rb
it-logica-application-backbone-1.1.7 lib/table_settings/detail_table.rb
it-logica-application-backbone-1.1.6 lib/table_settings/detail_table.rb
it-logica-application-backbone-1.1.5 lib/table_settings/detail_table.rb
it-logica-application-backbone-1.1.4 lib/table_settings/detail_table.rb
it-logica-application-backbone-1.1.3 lib/table_settings/detail_table.rb
it-logica-application-backbone-1.1.2 lib/table_settings/detail_table.rb