Class: ActiveRecord::Relation::FromClause

Inherits:
Object
  • Object
show all
Defined in:
activerecord/lib/active_record/relation/from_clause.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value, name) ⇒ FromClause

Returns a new instance of FromClause.



8
9
10
11
# File 'activerecord/lib/active_record/relation/from_clause.rb', line 8

def initialize(value, name)
  @value = value
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name



6
7
8
# File 'activerecord/lib/active_record/relation/from_clause.rb', line 6

def name
  @name
end

#valueObject (readonly)

Returns the value of attribute value



6
7
8
# File 'activerecord/lib/active_record/relation/from_clause.rb', line 6

def value
  @value
end

Class Method Details

.emptyObject



25
26
27
# File 'activerecord/lib/active_record/relation/from_clause.rb', line 25

def self.empty
  @empty ||= new(nil, nil).freeze
end

Instance Method Details

#==(other) ⇒ Object



21
22
23
# File 'activerecord/lib/active_record/relation/from_clause.rb', line 21

def ==(other)
  self.class == other.class && value == other.value && name == other.name
end

#empty?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'activerecord/lib/active_record/relation/from_clause.rb', line 17

def empty?
  value.nil?
end

#merge(other) ⇒ Object



13
14
15
# File 'activerecord/lib/active_record/relation/from_clause.rb', line 13

def merge(other)
  self
end