Class: Perpetuity::Postgres::QueryAttribute

Inherits:
Object
  • Object
show all
Defined in:
lib/perpetuity/postgres/query_attribute.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ QueryAttribute

Returns a new instance of QueryAttribute.



8
9
10
# File 'lib/perpetuity/postgres/query_attribute.rb', line 8

def initialize name
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/perpetuity/postgres/query_attribute.rb', line 6

def name
  @name
end

Instance Method Details

#in(collection) ⇒ Object



20
21
22
# File 'lib/perpetuity/postgres/query_attribute.rb', line 20

def in collection
  QueryExpression.new self, :in, collection
end

#nil?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/perpetuity/postgres/query_attribute.rb', line 24

def nil?
  QueryExpression.new self, :==, nil
end

#to_sObject



28
29
30
# File 'lib/perpetuity/postgres/query_attribute.rb', line 28

def to_s
  name.to_s
end