Class: Perpetuity::Postgres::TableName
- Inherits:
-
Object
- Object
- Perpetuity::Postgres::TableName
- Defined in:
- lib/perpetuity/postgres/table_name.rb
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(name) ⇒ TableName
constructor
A new instance of TableName.
- #to_s ⇒ Object
Constructor Details
#initialize(name) ⇒ TableName
Returns a new instance of TableName.
5 6 7 8 |
# File 'lib/perpetuity/postgres/table_name.rb', line 5 def initialize name @name = name.to_s raise InvalidTableName, "PostgreSQL table name cannot contain double quotes" if @name.include? '"' end |
Instance Method Details
#==(other) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/perpetuity/postgres/table_name.rb', line 14 def == other if other.is_a? String other == @name else to_s == other.to_s end end |
#to_s ⇒ Object
10 11 12 |
# File 'lib/perpetuity/postgres/table_name.rb', line 10 def to_s @name.to_s.inspect end |