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
- #auth_method ⇒ Object
-
#countable ⇒ Object
Returns the value of attribute countable.
-
#creatable ⇒ Object
Returns the value of attribute creatable.
-
#destroyable ⇒ Object
Returns the value of attribute destroyable.
-
#filterable ⇒ Object
Returns the value of attribute filterable.
-
#id_listable ⇒ Object
Returns the value of attribute id_listable.
-
#listable ⇒ Object
Returns the value of attribute listable.
-
#raw_mime_type ⇒ Object
Returns the value of attribute raw_mime_type.
- #resources_path ⇒ Object
-
#searchable ⇒ Object
Returns the value of attribute searchable.
-
#showable ⇒ Object
Returns the value of attribute showable.
-
#updatable ⇒ Object
Returns the value of attribute updatable.
Instance Method Summary collapse
- #countable? ⇒ Boolean
- #creatable? ⇒ Boolean
- #destroyable? ⇒ Boolean
- #exposable_as_raw? ⇒ Boolean
- #filterable? ⇒ Boolean
- #from_hash(data, api:) ⇒ Object
- #from_json(json, api:) ⇒ Object
- #id_listable? ⇒ Boolean
- #init_operations ⇒ Object
- #listable? ⇒ Boolean
- #searchable? ⇒ Boolean
- #showable? ⇒ Boolean
- #updatable? ⇒ Boolean
Instance Attribute Details
#auth_method ⇒ Object
199 200 201 |
# File 'lib/nylas/model.rb', line 199 def auth_method(*) @auth_method || HttpClient::AuthMethod::BEARER end |
#countable ⇒ Object
Returns the value of attribute countable.
143 144 145 |
# File 'lib/nylas/model.rb', line 143 def countable @countable end |
#creatable ⇒ Object
Returns the value of attribute creatable.
143 144 145 |
# File 'lib/nylas/model.rb', line 143 def creatable @creatable end |
#destroyable ⇒ Object
Returns the value of attribute destroyable.
143 144 145 |
# File 'lib/nylas/model.rb', line 143 def destroyable @destroyable end |
#filterable ⇒ Object
Returns the value of attribute filterable.
143 144 145 |
# File 'lib/nylas/model.rb', line 143 def filterable @filterable end |
#id_listable ⇒ Object
Returns the value of attribute id_listable.
143 144 145 |
# File 'lib/nylas/model.rb', line 143 def id_listable @id_listable end |
#listable ⇒ Object
Returns the value of attribute listable.
143 144 145 |
# File 'lib/nylas/model.rb', line 143 def listable @listable end |
#raw_mime_type ⇒ Object
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_path ⇒ Object
195 196 197 |
# File 'lib/nylas/model.rb', line 195 def resources_path(*) @resources_path end |
#searchable ⇒ Object
Returns the value of attribute searchable.
143 144 145 |
# File 'lib/nylas/model.rb', line 143 def searchable @searchable end |
#showable ⇒ Object
Returns the value of attribute showable.
143 144 145 |
# File 'lib/nylas/model.rb', line 143 def showable @showable end |
#updatable ⇒ Object
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
191 192 193 |
# File 'lib/nylas/model.rb', line 191 def countable? countable end |
#creatable? ⇒ Boolean
159 160 161 |
# File 'lib/nylas/model.rb', line 159 def creatable? creatable end |
#destroyable? ⇒ Boolean
183 184 185 |
# File 'lib/nylas/model.rb', line 183 def destroyable? destroyable end |
#exposable_as_raw? ⇒ Boolean
203 204 205 |
# File 'lib/nylas/model.rb', line 203 def exposable_as_raw? !raw_mime_type.nil? end |
#filterable? ⇒ 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
187 188 189 |
# File 'lib/nylas/model.rb', line 187 def id_listable? id_listable end |
#init_operations ⇒ Object
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
167 168 169 |
# File 'lib/nylas/model.rb', line 167 def listable? listable end |
#searchable? ⇒ Boolean
175 176 177 |
# File 'lib/nylas/model.rb', line 175 def searchable? searchable end |
#showable? ⇒ Boolean
163 164 165 |
# File 'lib/nylas/model.rb', line 163 def showable? showable end |
#updatable? ⇒ Boolean
179 180 181 |
# File 'lib/nylas/model.rb', line 179 def updatable? updatable end |