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(id = nil, name = nil, description = nil, owner_id = nil, resource_type = nil, capacity = nil, gender = nil, thing_type_id = nil, primary_cal = nil) ⇒ EntitiesResourceResponse
constructor
A new instance of EntitiesResourceResponse.
Methods inherited from BaseModel
Constructor Details
#initialize(id = nil, name = nil, description = nil, owner_id = nil, resource_type = nil, capacity = nil, gender = nil, thing_type_id = nil, primary_cal = 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(id = nil, name = nil, description = nil, owner_id = nil, resource_type = nil, capacity = nil, gender = nil, thing_type_id = nil, primary_cal = nil) @id = id @name = name @description = description @owner_id = owner_id @resource_type = resource_type @capacity = capacity @gender = gender @thing_type_id = thing_type_id @primary_cal = primary_cal end |
Instance Attribute Details
#capacity ⇒ Integer
capacity of Resource, if applicable
27 28 29 |
# File 'lib/gonebusy/models/entities_resource_response.rb', line 27 def capacity @capacity end |
#description ⇒ String
description of Resource
15 16 17 |
# File 'lib/gonebusy/models/entities_resource_response.rb', line 15 def description @description end |
#gender ⇒ String
gender of Resource, if applicable
31 32 33 |
# File 'lib/gonebusy/models/entities_resource_response.rb', line 31 def gender @gender end |
#id ⇒ Integer
id of Resource
7 8 9 |
# File 'lib/gonebusy/models/entities_resource_response.rb', line 7 def id @id end |
#name ⇒ String
name of Resource
11 12 13 |
# File 'lib/gonebusy/models/entities_resource_response.rb', line 11 def name @name end |
#owner_id ⇒ Integer
id of User owning Resource
19 20 21 |
# File 'lib/gonebusy/models/entities_resource_response.rb', line 19 def owner_id @owner_id end |
#primary_cal ⇒ Boolean
if Calendar is primary, if applicable
39 40 41 |
# File 'lib/gonebusy/models/entities_resource_response.rb', line 39 def primary_cal @primary_cal end |
#resource_type ⇒ String
type of Resource
23 24 25 |
# File 'lib/gonebusy/models/entities_resource_response.rb', line 23 def resource_type @resource_type end |
#thing_type_id ⇒ Integer
type Id of Thing Resource, if applicable
35 36 37 |
# File 'lib/gonebusy/models/entities_resource_response.rb', line 35 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 |
# File 'lib/gonebusy/models/entities_resource_response.rb', line 79 def self.from_hash(hash) return nil unless hash # Extract variables from the hash id = hash['id'] name = hash['name'] description = hash['description'] owner_id = hash['owner_id'] resource_type = hash['resource_type'] capacity = hash['capacity'] gender = hash['gender'] thing_type_id = hash['thing_type_id'] primary_cal = hash['primary_cal'] # Create object from extracted values EntitiesResourceResponse.new(id, name, description, owner_id, resource_type, capacity, gender, thing_type_id, primary_cal) 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["id"] = "id" @_hash["name"] = "name" @_hash["description"] = "description" @_hash["owner_id"] = "owner_id" @_hash["resource_type"] = "resource_type" @_hash["capacity"] = "capacity" @_hash["gender"] = "gender" @_hash["thing_type_id"] = "thing_type_id" @_hash["primary_cal"] = "primary_cal" end @_hash end |