Class: CtdDocumentation::ActivitiesObject
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- CtdDocumentation::ActivitiesObject
- Defined in:
- lib/ctd_documentation/models/activities_object.rb
Overview
ActivitiesObject Model.
Instance Attribute Summary collapse
-
#description ⇒ String
TODO: Write general description for this method.
-
#display_type ⇒ String
TODO: Write general description for this method.
-
#entity ⇒ Entity
TODO: Write general description for this method.
-
#id ⇒ Integer
TODO: Write general description for this method.
-
#resource_id ⇒ String
TODO: Write general description for this method.
-
#site_id ⇒ Integer
TODO: Write general description for this method.
-
#site_name ⇒ String
TODO: Write general description for this method.
-
#timestamp ⇒ String
TODO: Write general description for this method.
-
#type ⇒ Integer
TODO: Write general description for this method.
-
#user_id ⇒ String
TODO: Write general description for this method.
-
#user_name ⇒ String
TODO: Write general description for this method.
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.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(description = SKIP, display_type = SKIP, entity = SKIP, id = SKIP, resource_id = SKIP, site_id = SKIP, site_name = SKIP, timestamp = SKIP, type = SKIP, user_id = SKIP, user_name = SKIP) ⇒ ActivitiesObject
constructor
A new instance of ActivitiesObject.
Methods inherited from BaseModel
Constructor Details
#initialize(description = SKIP, display_type = SKIP, entity = SKIP, id = SKIP, resource_id = SKIP, site_id = SKIP, site_name = SKIP, timestamp = SKIP, type = SKIP, user_id = SKIP, user_name = SKIP) ⇒ ActivitiesObject
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/ctd_documentation/models/activities_object.rb', line 95 def initialize(description = SKIP, display_type = SKIP, entity = SKIP, id = SKIP, resource_id = SKIP, site_id = SKIP, site_name = SKIP, = SKIP, type = SKIP, user_id = SKIP, user_name = SKIP) @description = description unless description == SKIP @display_type = display_type unless display_type == SKIP @entity = entity unless entity == SKIP @id = id unless id == SKIP @resource_id = resource_id unless resource_id == SKIP @site_id = site_id unless site_id == SKIP @site_name = site_name unless site_name == SKIP = unless == SKIP @type = type unless type == SKIP @user_id = user_id unless user_id == SKIP @user_name = user_name unless user_name == SKIP end |
Instance Attribute Details
#description ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/ctd_documentation/models/activities_object.rb', line 14 def description @description end |
#display_type ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/ctd_documentation/models/activities_object.rb', line 18 def display_type @display_type end |
#entity ⇒ Entity
TODO: Write general description for this method
22 23 24 |
# File 'lib/ctd_documentation/models/activities_object.rb', line 22 def entity @entity end |
#id ⇒ Integer
TODO: Write general description for this method
26 27 28 |
# File 'lib/ctd_documentation/models/activities_object.rb', line 26 def id @id end |
#resource_id ⇒ String
TODO: Write general description for this method
30 31 32 |
# File 'lib/ctd_documentation/models/activities_object.rb', line 30 def resource_id @resource_id end |
#site_id ⇒ Integer
TODO: Write general description for this method
34 35 36 |
# File 'lib/ctd_documentation/models/activities_object.rb', line 34 def site_id @site_id end |
#site_name ⇒ String
TODO: Write general description for this method
38 39 40 |
# File 'lib/ctd_documentation/models/activities_object.rb', line 38 def site_name @site_name end |
#timestamp ⇒ String
TODO: Write general description for this method
42 43 44 |
# File 'lib/ctd_documentation/models/activities_object.rb', line 42 def end |
#type ⇒ Integer
TODO: Write general description for this method
46 47 48 |
# File 'lib/ctd_documentation/models/activities_object.rb', line 46 def type @type end |
#user_id ⇒ String
TODO: Write general description for this method
50 51 52 |
# File 'lib/ctd_documentation/models/activities_object.rb', line 50 def user_id @user_id end |
#user_name ⇒ String
TODO: Write general description for this method
54 55 56 |
# File 'lib/ctd_documentation/models/activities_object.rb', line 54 def user_name @user_name end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
# File 'lib/ctd_documentation/models/activities_object.rb', line 120 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. description = hash.key?('description') ? hash['description'] : SKIP display_type = hash.key?('display_type') ? hash['display_type'] : SKIP entity = Entity.from_hash(hash['entity']) if hash['entity'] id = hash.key?('id') ? hash['id'] : SKIP resource_id = hash.key?('resource_id') ? hash['resource_id'] : SKIP site_id = hash.key?('site_id') ? hash['site_id'] : SKIP site_name = hash.key?('site_name') ? hash['site_name'] : SKIP = hash.key?('timestamp') ? hash['timestamp'] : SKIP type = hash.key?('type') ? hash['type'] : SKIP user_id = hash.key?('user_id') ? hash['user_id'] : SKIP user_name = hash.key?('user_name') ? hash['user_name'] : SKIP # Create object from extracted values. ActivitiesObject.new(description, display_type, entity, id, resource_id, site_id, site_name, , type, user_id, user_name) end |
.names ⇒ Object
A mapping from model property names to API property names.
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/ctd_documentation/models/activities_object.rb', line 57 def self.names @_hash = {} if @_hash.nil? @_hash['description'] = 'description' @_hash['display_type'] = 'display_type' @_hash['entity'] = 'entity' @_hash['id'] = 'id' @_hash['resource_id'] = 'resource_id' @_hash['site_id'] = 'site_id' @_hash['site_name'] = 'site_name' @_hash['timestamp'] = 'timestamp' @_hash['type'] = 'type' @_hash['user_id'] = 'user_id' @_hash['user_name'] = 'user_name' @_hash end |
.nullables ⇒ Object
An array for nullable fields
91 92 93 |
# File 'lib/ctd_documentation/models/activities_object.rb', line 91 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/ctd_documentation/models/activities_object.rb', line 74 def self.optionals %w[ description display_type entity id resource_id site_id site_name timestamp type user_id user_name ] end |