Sha256: 072ee0535a34323e3da6d679363fbd9b29d45f652f6ab9cb91f0cbe129261fdd

Contents?: true

Size: 754 Bytes

Versions: 7

Compression:

Stored size: 754 Bytes

Contents

# Column abstraction for Rhubarb.
#
# Copyright (c) 2009--2010 Red Hat, Inc.
#
# Author:  William Benton (willb@redhat.com)
# 
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# 
#     http://www.apache.org/licenses/LICENSE-2.0

module Rhubarb
  class Column
    attr_reader :name

    def initialize(name, kind, quals)
      @name, @kind = name, kind
      @quals = quals.map {|x| x.to_s.gsub("_", " ") if x.class == Symbol}
      @quals.map 
    end

    def to_s
      qualifiers = @quals.join(" ")
      if qualifiers == ""
        "#@name #@kind"
      else
        "#@name #@kind #{qualifiers}"
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rhubarb-0.2.7 lib/rhubarb/column.rb
rhubarb-0.2.6 lib/rhubarb/column.rb
rhubarb-0.2.5 lib/rhubarb/column.rb
rhubarb-0.2.4 lib/rhubarb/column.rb
rhubarb-0.2.3 lib/rhubarb/column.rb
rhubarb-0.2.2 lib/rhubarb/column.rb
rhubarb-0.2.1 lib/rhubarb/column.rb