Class: Cadenya::Types::WorkspaceMember

Inherits:
Object
  • Object
show all
Defined in:
lib/cadenya/types.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(profile_id: nil, actor_id: nil, name: nil, email: nil, added_at: nil) ⇒ WorkspaceMember

Returns a new instance of WorkspaceMember.



7555
7556
7557
7558
7559
7560
7561
# File 'lib/cadenya/types.rb', line 7555

def initialize(profile_id: nil, actor_id: nil, name: nil, email: nil, added_at: nil)
  @profile_id = profile_id
  @actor_id = actor_id
  @name = name
  @email = email
  @added_at = added_at
end

Instance Attribute Details

#actor_idObject (readonly)

Returns the value of attribute actor_id.



7553
7554
7555
# File 'lib/cadenya/types.rb', line 7553

def actor_id
  @actor_id
end

#added_atObject (readonly)

Returns the value of attribute added_at.



7553
7554
7555
# File 'lib/cadenya/types.rb', line 7553

def added_at
  @added_at
end

#emailObject (readonly)

Returns the value of attribute email.



7553
7554
7555
# File 'lib/cadenya/types.rb', line 7553

def email
  @email
end

#nameObject (readonly)

Returns the value of attribute name.



7553
7554
7555
# File 'lib/cadenya/types.rb', line 7553

def name
  @name
end

#profile_idObject (readonly)

Returns the value of attribute profile_id.



7553
7554
7555
# File 'lib/cadenya/types.rb', line 7553

def profile_id
  @profile_id
end

Class Method Details

.from_json(data) ⇒ Object



7563
7564
7565
7566
7567
7568
7569
7570
7571
# File 'lib/cadenya/types.rb', line 7563

def self.from_json(data)
  new(
    profile_id: data["profileId"],
    actor_id: data["actorId"],
    name: data["name"],
    email: data["email"],
    added_at: data["addedAt"].nil? ? nil : Time.iso8601(data["addedAt"]),
  )
end

Instance Method Details

#to_hObject



7573
7574
7575
7576
7577
7578
7579
7580
7581
# File 'lib/cadenya/types.rb', line 7573

def to_h
  {
    profile_id: Util.plain(@profile_id),
    actor_id: Util.plain(@actor_id),
    name: Util.plain(@name),
    email: Util.plain(@email),
    added_at: Util.plain(@added_at),
  }.reject { |_k, v| v.nil? }
end