Class: Lara::Models::MemoryShares

Inherits:
Base
  • Object
show all
Defined in:
lib/lara/models/shares.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

parse_time

Constructor Details

#initialize(memory:, account: nil, groups: [], users: [], **_kwargs) ⇒ MemoryShares

Returns a new instance of MemoryShares.



23
24
25
26
27
28
29
# File 'lib/lara/models/shares.rb', line 23

def initialize(memory:, account: nil, groups: [], users: [], **_kwargs)
  super()
  @memory = Memory.new(**memory.transform_keys(&:to_sym))
  @account = ResourceShareEntry.new(**.transform_keys(&:to_sym)) if 
  @groups = groups.map { |entry| ResourceShareEntry.new(**entry.transform_keys(&:to_sym)) }
  @users = users.map { |entry| ResourceShareEntry.new(**entry.transform_keys(&:to_sym)) }
end

Instance Attribute Details

#accountObject (readonly)

Returns the value of attribute account.



21
22
23
# File 'lib/lara/models/shares.rb', line 21

def 
  @account
end

#groupsObject (readonly)

Returns the value of attribute groups.



21
22
23
# File 'lib/lara/models/shares.rb', line 21

def groups
  @groups
end

#memoryObject (readonly)

Returns the value of attribute memory.



21
22
23
# File 'lib/lara/models/shares.rb', line 21

def memory
  @memory
end

#usersObject (readonly)

Returns the value of attribute users.



21
22
23
# File 'lib/lara/models/shares.rb', line 21

def users
  @users
end