Class: SDM::ActivityEntity
- Inherits:
-
Object
- Object
- SDM::ActivityEntity
- Defined in:
- lib/models/porcelain.rb
Instance Attribute Summary collapse
-
#email ⇒ Object
The email of the affected entity, if it has one (for example, if it is an account).
-
#external_id ⇒ Object
The external ID of the affected entity, if it has one (for example, if it is an account).
-
#id ⇒ Object
The unique identifier of the entity this activity affected.
-
#name ⇒ Object
A display name representing the affected entity.
-
#type ⇒ Object
The type of entity affected, one of the Activity Entities constants.
Instance Method Summary collapse
-
#initialize(email: nil, external_id: nil, id: nil, name: nil, type: nil) ⇒ ActivityEntity
constructor
A new instance of ActivityEntity.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(email: nil, external_id: nil, id: nil, name: nil, type: nil) ⇒ ActivityEntity
Returns a new instance of ActivityEntity.
1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 |
# File 'lib/models/porcelain.rb', line 1326 def initialize( email: nil, external_id: nil, id: nil, name: nil, type: nil ) @email = email == nil ? "" : email @external_id = external_id == nil ? "" : external_id @id = id == nil ? "" : id @name = name == nil ? "" : name @type = type == nil ? "" : type end |
Instance Attribute Details
#email ⇒ Object
The email of the affected entity, if it has one (for example, if it is an account).
1316 1317 1318 |
# File 'lib/models/porcelain.rb', line 1316 def email @email end |
#external_id ⇒ Object
The external ID of the affected entity, if it has one (for example, if it is an account).
1318 1319 1320 |
# File 'lib/models/porcelain.rb', line 1318 def external_id @external_id end |
#id ⇒ Object
The unique identifier of the entity this activity affected.
1320 1321 1322 |
# File 'lib/models/porcelain.rb', line 1320 def id @id end |
#name ⇒ Object
A display name representing the affected entity.
1322 1323 1324 |
# File 'lib/models/porcelain.rb', line 1322 def name @name end |
#type ⇒ Object
The type of entity affected, one of the Activity Entities constants.
1324 1325 1326 |
# File 'lib/models/porcelain.rb', line 1324 def type @type end |
Instance Method Details
#to_json(options = {}) ⇒ Object
1340 1341 1342 1343 1344 1345 1346 |
# File 'lib/models/porcelain.rb', line 1340 def to_json( = {}) hash = {} self.instance_variables.each do |var| hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var end hash.to_json end |