Module: Nylas::Model::ClassMethods

Defined in:
lib/nylas/model.rb

Overview

Allows you to narrow in exactly what kind of model you're working with

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#auth_methodObject



199
200
201
# File 'lib/nylas/model.rb', line 199

def auth_method(*)
  @auth_method || HttpClient::AuthMethod::BEARER
end

#countableObject

Returns the value of attribute countable.



143
144
145
# File 'lib/nylas/model.rb', line 143

def countable
  @countable
end

#creatableObject

Returns the value of attribute creatable.



143
144
145
# File 'lib/nylas/model.rb', line 143

def creatable
  @creatable
end

#destroyableObject

Returns the value of attribute destroyable.



143
144
145
# File 'lib/nylas/model.rb', line 143

def destroyable
  @destroyable
end

#filterableObject

Returns the value of attribute filterable.



143
144
145
# File 'lib/nylas/model.rb', line 143

def filterable
  @filterable
end

#id_listableObject

Returns the value of attribute id_listable.



143
144
145
# File 'lib/nylas/model.rb', line 143

def id_listable
  @id_listable
end

#listableObject

Returns the value of attribute listable.



143
144
145
# File 'lib/nylas/model.rb', line 143

def listable
  @listable
end

#raw_mime_typeObject

Returns the value of attribute raw_mime_type.



143
144
145
# File 'lib/nylas/model.rb', line 143

def raw_mime_type
  @raw_mime_type
end

#resources_pathObject



195
196
197
# File 'lib/nylas/model.rb', line 195

def resources_path(*)
  @resources_path
end

#searchableObject

Returns the value of attribute searchable.



143
144
145
# File 'lib/nylas/model.rb', line 143

def searchable
  @searchable
end

#showableObject

Returns the value of attribute showable.



143
144
145
# File 'lib/nylas/model.rb', line 143

def showable
  @showable
end

#updatableObject

Returns the value of attribute updatable.



143
144
145
# File 'lib/nylas/model.rb', line 143

def updatable
  @updatable
end

Instance Method Details

#countable?Boolean

Returns:

  • (Boolean)


191
192
193
# File 'lib/nylas/model.rb', line 191

def countable?
  countable
end

#creatable?Boolean

Returns:

  • (Boolean)


159
160
161
# File 'lib/nylas/model.rb', line 159

def creatable?
  creatable
end

#destroyable?Boolean

Returns:

  • (Boolean)


183
184
185
# File 'lib/nylas/model.rb', line 183

def destroyable?
  destroyable
end

#exposable_as_raw?Boolean

Returns:

  • (Boolean)


203
204
205
# File 'lib/nylas/model.rb', line 203

def exposable_as_raw?
  !raw_mime_type.nil?
end

#filterable?Boolean

Returns:

  • (Boolean)


171
172
173
# File 'lib/nylas/model.rb', line 171

def filterable?
  filterable
end

#from_hash(data, api:) ⇒ Object



211
212
213
214
# File 'lib/nylas/model.rb', line 211

def from_hash(data, api:)
  instance = new(**data.merge(api: api))
  instance
end

#from_json(json, api:) ⇒ Object



207
208
209
# File 'lib/nylas/model.rb', line 207

def from_json(json, api:)
  from_hash(JSON.parse(json, symbolize_names: true), api: api)
end

#id_listable?Boolean

Returns:

  • (Boolean)


187
188
189
# File 'lib/nylas/model.rb', line 187

def id_listable?
  id_listable
end

#init_operationsObject



147
148
149
150
151
152
153
154
155
156
157
# File 'lib/nylas/model.rb', line 147

def init_operations
  self.creatable = false
  self.showable = false
  self.listable = false
  self.filterable = false
  self.searchable = false
  self.updatable = false
  self.destroyable = false
  self.id_listable = false
  self.countable = false
end

#listable?Boolean

Returns:

  • (Boolean)


167
168
169
# File 'lib/nylas/model.rb', line 167

def listable?
  listable
end

#searchable?Boolean

Returns:

  • (Boolean)


175
176
177
# File 'lib/nylas/model.rb', line 175

def searchable?
  searchable
end

#showable?Boolean

Returns:

  • (Boolean)


163
164
165
# File 'lib/nylas/model.rb', line 163

def showable?
  showable
end

#updatable?Boolean

Returns:

  • (Boolean)


179
180
181
# File 'lib/nylas/model.rb', line 179

def updatable?
  updatable
end