Class: ActionMerge::Peer

Inherits:
Object
  • Object
show all
Defined in:
app/models/action_merge/peer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, isEphemeral: nil, storageId: nil, model: nil) ⇒ Peer



5
6
7
8
9
10
# File 'app/models/action_merge/peer.rb', line 5

def initialize(id, isEphemeral: nil, storageId: nil, model: nil)
  @id = id
  @isEphemeral = isEphemeral
  @storageId = storageId
  @model = model
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



3
4
5
# File 'app/models/action_merge/peer.rb', line 3

def id
  @id
end

#isEphemeralObject

Returns the value of attribute isEphemeral.



3
4
5
# File 'app/models/action_merge/peer.rb', line 3

def isEphemeral
  @isEphemeral
end

#modelObject

Returns the value of attribute model.



3
4
5
# File 'app/models/action_merge/peer.rb', line 3

def model
  @model
end

#storageIdObject

Returns the value of attribute storageId.



3
4
5
# File 'app/models/action_merge/peer.rb', line 3

def storageId
  @storageId
end

Instance Method Details

#metadataObject



12
13
14
15
16
17
# File 'app/models/action_merge/peer.rb', line 12

def 
  {
    isEphemeral:,
    storageId:
  }
end

#to_gid_paramObject



19
20
21
# File 'app/models/action_merge/peer.rb', line 19

def to_gid_param
  [[@model.class.name, @model.id], id]
end