Class: Kintone::Query::Field

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

Instance Method Summary collapse

Constructor Details

#initialize(code) ⇒ Field



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

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

Instance Method Details

#!=(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

#<=(other) ⇒ Object



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

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

#==(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

#in(other) ⇒ Object



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

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

#inspectObject



141
142
143
# File 'lib/kintone/query.rb', line 141

def inspect
  to_s
end

#like(other) ⇒ Object



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

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

#not_in(other) ⇒ Object



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

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



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

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

#to_sObject



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

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