Sha256: 55c36b44bb704e55a0e45e683ef38d3e0970a0f67b0ca5fc7fb97323e1271d2e

Contents?: true

Size: 439 Bytes

Versions: 6

Compression:

Stored size: 439 Bytes

Contents

class SPAttribute
  attr_accessor :attributes, :table_name

  def initialize(attributes: [], table_name: nil)
    @attributes = attributes
    @table_name = table_name
  end

  def add_attribute(attribute)
    @attributes << attribute
  end

  def get_full_column_name(attribute)
    if @attributes.include? attribute
      "#{@table_name}.#{attribute}"
    else
      raise 'Attribute not present in the attribute list.'
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
seek_party-0.0.9 lib/seek_party/models/sp_attribute.rb
seek_party-0.0.8 lib/seek_party/models/sp_attribute.rb
seek_party-0.0.7 lib/seek_party/models/sp_attribute.rb
seek_party-0.0.5 lib/seek_party/models/sp_attribute.rb
seek_party-0.0.4 lib/seek_party/models/sp_attribute.rb
seek_party-0.0.3 lib/seek_party/models/sp_attribute.rb