class SPAttribute

Attributes

attributes[RW]
table_name[RW]

Public Class Methods

new(attributes: [], table_name: nil) click to toggle source
# File lib/seek_party/models/sp_attribute.rb, line 4
def initialize(attributes: [], table_name: nil)
  @attributes = attributes
  @table_name = table_name
end

Public Instance Methods

add_attribute(attribute) click to toggle source
# File lib/seek_party/models/sp_attribute.rb, line 9
def add_attribute(attribute)
  @attributes << attribute
end
get_full_column_name(attribute) click to toggle source
# File lib/seek_party/models/sp_attribute.rb, line 13
def get_full_column_name(attribute)
  if @attributes.include? attribute
    "#{@table_name}.#{attribute}"
  else
    raise 'Attribute not present in the attribute list.'
  end
end