Class: SDM::ActivityActor

Inherits:
Object
  • Object
show all
Defined in:
lib/models/porcelain.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(activity_external_id: nil, email: nil, first_name: nil, id: nil, last_name: nil) ⇒ ActivityActor

Returns a new instance of ActivityActor.



1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
# File 'lib/models/porcelain.rb', line 1575

def initialize(
  activity_external_id: nil,
  email: nil,
  first_name: nil,
  id: nil,
  last_name: nil
)
  @activity_external_id = activity_external_id == nil ? "" : activity_external_id
  @email = email == nil ? "" : email
  @first_name = first_name == nil ? "" : first_name
  @id = id == nil ? "" : id
  @last_name = last_name == nil ? "" : last_name
end

Instance Attribute Details

#activity_external_idObject

The external ID of the actor at the time this activity occurred.



1565
1566
1567
# File 'lib/models/porcelain.rb', line 1565

def activity_external_id
  @activity_external_id
end

#emailObject

The email of the actor at the time this activity occurred.



1567
1568
1569
# File 'lib/models/porcelain.rb', line 1567

def email
  @email
end

#first_nameObject

The first name of the actor at the time this activity occurred.



1569
1570
1571
# File 'lib/models/porcelain.rb', line 1569

def first_name
  @first_name
end

#idObject

Unique identifier of the actor. Immutable.



1571
1572
1573
# File 'lib/models/porcelain.rb', line 1571

def id
  @id
end

#last_nameObject

The last name of the actor at the time this activity occurred.



1573
1574
1575
# File 'lib/models/porcelain.rb', line 1573

def last_name
  @last_name
end

Instance Method Details

#to_json(options = {}) ⇒ Object



1589
1590
1591
1592
1593
1594
1595
# File 'lib/models/porcelain.rb', line 1589

def to_json(options = {})
  hash = {}
  self.instance_variables.each do |var|
    hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var
  end
  hash.to_json
end