Class: Kintone::Query::Field

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

Instance Method Summary collapse

Constructor Details

#initialize(code) ⇒ Field

Returns a new instance of Field.



87
88
89
# File 'lib/kintone/query.rb', line 87

def initialize(code)
  @code = code.to_s
end

Instance Method Details

#!=(other) ⇒ Object



95
96
97
# File 'lib/kintone/query.rb', line 95

def !=(other)
  save('!=', other.query_format)
end

#<(other) ⇒ Object



103
104
105
# File 'lib/kintone/query.rb', line 103

def <(other)
  save('<', other.query_format)
end

#<=(other) ⇒ Object



111
112
113
# File 'lib/kintone/query.rb', line 111

def <=(other)
  save('<=', other.query_format)
end

#==(other) ⇒ Object



91
92
93
# File 'lib/kintone/query.rb', line 91

def ==(other)
  save('=', other.query_format)
end

#>(other) ⇒ Object



99
100
101
# File 'lib/kintone/query.rb', line 99

def >(other)
  save('>', other.query_format)
end

#>=(other) ⇒ Object



107
108
109
# File 'lib/kintone/query.rb', line 107

def >=(other)
  save('>=', other.query_format)
end

#in(other) ⇒ Object



115
116
117
118
# File 'lib/kintone/query.rb', line 115

def in(other)
  other = "(#{other.map { |v| v.query_format }.join(', ')})" if other.is_a?(Array)
  save('in', other)
end

#inspectObject



137
138
139
# File 'lib/kintone/query.rb', line 137

def inspect
  to_s
end

#like(other) ⇒ Object



125
126
127
# File 'lib/kintone/query.rb', line 125

def like(other)
  save('like', other.query_format)
end

#not_in(other) ⇒ Object



120
121
122
123
# File 'lib/kintone/query.rb', line 120

def not_in(other)
  other = "(#{other.map { |v| v.query_format }.join(', ')})" if other.is_a?(Array)
  save('not in', other)
end

#not_like(other) ⇒ Object



129
130
131
# File 'lib/kintone/query.rb', line 129

def not_like(other)
  save('not like', other.query_format)
end

#to_sObject



133
134
135
# File 'lib/kintone/query.rb', line 133

def to_s
  "#{@code} #{@condition} #{@other}"
end