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.
1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 |
# File 'lib/models/porcelain.rb', line 1490 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).
1480 1481 1482 |
# File 'lib/models/porcelain.rb', line 1480 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).
1482 1483 1484 |
# File 'lib/models/porcelain.rb', line 1482 def external_id @external_id end |
#id ⇒ Object
The unique identifier of the entity this activity affected.
1484 1485 1486 |
# File 'lib/models/porcelain.rb', line 1484 def id @id end |
#name ⇒ Object
A display name representing the affected entity.
1486 1487 1488 |
# File 'lib/models/porcelain.rb', line 1486 def name @name end |
#type ⇒ Object
The type of entity affected, one of the Activity Entities constants.
1488 1489 1490 |
# File 'lib/models/porcelain.rb', line 1488 def type @type end |
Instance Method Details
#to_json(options = {}) ⇒ Object
1504 1505 1506 1507 1508 1509 1510 |
# File 'lib/models/porcelain.rb', line 1504 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 |