Class: Lara::Models::MemoryShares
- Defined in:
- lib/lara/models/shares.rb
Instance Attribute Summary collapse
-
#account ⇒ Object
readonly
Returns the value of attribute account.
-
#groups ⇒ Object
readonly
Returns the value of attribute groups.
-
#memory ⇒ Object
readonly
Returns the value of attribute memory.
-
#users ⇒ Object
readonly
Returns the value of attribute users.
Instance Method Summary collapse
-
#initialize(memory:, account: nil, groups: [], users: [], **_kwargs) ⇒ MemoryShares
constructor
A new instance of MemoryShares.
Methods inherited from Base
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(**account.transform_keys(&:to_sym)) if account @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
#account ⇒ Object (readonly)
Returns the value of attribute account.
21 22 23 |
# File 'lib/lara/models/shares.rb', line 21 def account @account end |
#groups ⇒ Object (readonly)
Returns the value of attribute groups.
21 22 23 |
# File 'lib/lara/models/shares.rb', line 21 def groups @groups end |
#memory ⇒ Object (readonly)
Returns the value of attribute memory.
21 22 23 |
# File 'lib/lara/models/shares.rb', line 21 def memory @memory end |
#users ⇒ Object (readonly)
Returns the value of attribute users.
21 22 23 |
# File 'lib/lara/models/shares.rb', line 21 def users @users end |