Class: Dynamicloud::API::Criteria::JoinType

Inherits:
Object
  • Object
show all
Defined in:
lib/dynamic_criteria.rb

Overview

This enum represents the different Join types

Constant Summary collapse

LEFT =
JoinType.new 1
RIGHT =
JoinType.new 2
INNER =
JoinType.new 3
LEFT_OUTER =
JoinType.new 4
RIGHT_OUTER =
JoinType.new 5

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type) ⇒ JoinType

Returns a new instance of JoinType.



26
27
28
# File 'lib/dynamic_criteria.rb', line 26

def initialize(type)
  @type = type
end

Instance Attribute Details

#typeObject

Returns the value of attribute type.



24
25
26
# File 'lib/dynamic_criteria.rb', line 24

def type
  @type
end

Instance Method Details

#to_stringObject

This method returns the text according to this Join Type.

Returns:

  • the text according to this Join Type.



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/dynamic_criteria.rb', line 39

def to_string
  case (@type)
    when LEFT.type
      return 'left'
    when RIGHT.type
      return 'right'
    when INNER.type
      return 'inner'
    when LEFT_OUTER.type
      return 'left outer'
    when RIGHT_OUTER.type
      return 'right outer'
    else
      return 'inner'
  end
end