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 ActivityEntityType 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.
2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 |
# File 'lib/models/porcelain.rb', line 2280 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).
2270 2271 2272 |
# File 'lib/models/porcelain.rb', line 2270 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).
2272 2273 2274 |
# File 'lib/models/porcelain.rb', line 2272 def external_id @external_id end |
#id ⇒ Object
The unique identifier of the entity this activity affected.
2274 2275 2276 |
# File 'lib/models/porcelain.rb', line 2274 def id @id end |
#name ⇒ Object
A display name representing the affected entity.
2276 2277 2278 |
# File 'lib/models/porcelain.rb', line 2276 def name @name end |
#type ⇒ Object
The type of entity affected, one of the ActivityEntityType constants.
2278 2279 2280 |
# File 'lib/models/porcelain.rb', line 2278 def type @type end |
Instance Method Details
#to_json(options = {}) ⇒ Object
2294 2295 2296 2297 2298 2299 2300 |
# File 'lib/models/porcelain.rb', line 2294 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 |