Class: Gonebusy::EntitiesResourceResponse
- Defined in:
- lib/gonebusy/models/entities_resource_response.rb
Instance Attribute Summary collapse
-
#capacity ⇒ Integer
capacity of Resource, if applicable.
-
#description ⇒ String
description of Resource.
-
#gender ⇒ String
gender of Resource, if applicable.
-
#id ⇒ Integer
id of Resource.
-
#name ⇒ String
name of Resource.
-
#owner_id ⇒ Integer
id of User owning Resource.
-
#primary_cal ⇒ Boolean
if Calendar is primary, if applicable.
-
#resource_type ⇒ String
type of Resource.
-
#thing_type_id ⇒ Integer
type Id of Thing Resource, if applicable.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
Instance Method Summary collapse
-
#initialize(capacity = nil, description = nil, gender = nil, id = nil, name = nil, owner_id = nil, primary_cal = nil, resource_type = nil, thing_type_id = nil) ⇒ EntitiesResourceResponse
constructor
A new instance of EntitiesResourceResponse.
Methods inherited from BaseModel
Constructor Details
#initialize(capacity = nil, description = nil, gender = nil, id = nil, name = nil, owner_id = nil, primary_cal = nil, resource_type = nil, thing_type_id = nil) ⇒ EntitiesResourceResponse
Returns a new instance of EntitiesResourceResponse.
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/gonebusy/models/entities_resource_response.rb', line 58 def initialize(capacity = nil, description = nil, gender = nil, id = nil, name = nil, owner_id = nil, primary_cal = nil, resource_type = nil, thing_type_id = nil) @capacity = capacity @description = description @gender = gender @id = id @name = name @owner_id = owner_id @primary_cal = primary_cal @resource_type = resource_type @thing_type_id = thing_type_id end |
Instance Attribute Details
#capacity ⇒ Integer
capacity of Resource, if applicable
7 8 9 |
# File 'lib/gonebusy/models/entities_resource_response.rb', line 7 def capacity @capacity end |
#description ⇒ String
description of Resource
11 12 13 |
# File 'lib/gonebusy/models/entities_resource_response.rb', line 11 def description @description end |
#gender ⇒ String
gender of Resource, if applicable
15 16 17 |
# File 'lib/gonebusy/models/entities_resource_response.rb', line 15 def gender @gender end |
#id ⇒ Integer
id of Resource
19 20 21 |
# File 'lib/gonebusy/models/entities_resource_response.rb', line 19 def id @id end |
#name ⇒ String
name of Resource
23 24 25 |
# File 'lib/gonebusy/models/entities_resource_response.rb', line 23 def name @name end |
#owner_id ⇒ Integer
id of User owning Resource
27 28 29 |
# File 'lib/gonebusy/models/entities_resource_response.rb', line 27 def owner_id @owner_id end |
#primary_cal ⇒ Boolean
if Calendar is primary, if applicable
31 32 33 |
# File 'lib/gonebusy/models/entities_resource_response.rb', line 31 def primary_cal @primary_cal end |
#resource_type ⇒ String
type of Resource
35 36 37 |
# File 'lib/gonebusy/models/entities_resource_response.rb', line 35 def resource_type @resource_type end |
#thing_type_id ⇒ Integer
type Id of Thing Resource, if applicable
39 40 41 |
# File 'lib/gonebusy/models/entities_resource_response.rb', line 39 def thing_type_id @thing_type_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/gonebusy/models/entities_resource_response.rb', line 79 def self.from_hash(hash) if hash == nil nil else # Extract variables from the hash capacity = hash["capacity"] description = hash["description"] gender = hash["gender"] id = hash["id"] name = hash["name"] owner_id = hash["owner_id"] primary_cal = hash["primary_cal"] resource_type = hash["resource_type"] thing_type_id = hash["thing_type_id"] # Create object from extracted values EntitiesResourceResponse.new(capacity, description, gender, id, name, owner_id, primary_cal, resource_type, thing_type_id) end end |
.names ⇒ Object
A mapping from model property names to API property names
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/gonebusy/models/entities_resource_response.rb', line 42 def self.names if @hash.nil? @hash = {} @hash["capacity"] = "capacity" @hash["description"] = "description" @hash["gender"] = "gender" @hash["id"] = "id" @hash["name"] = "name" @hash["owner_id"] = "owner_id" @hash["primary_cal"] = "primary_cal" @hash["resource_type"] = "resource_type" @hash["thing_type_id"] = "thing_type_id" end @hash end |