Class: Lara::Models::GlossaryShares
- Defined in:
- lib/lara/models/shares.rb
Instance Attribute Summary collapse
-
#account ⇒ Object
readonly
Returns the value of attribute account.
-
#glossary ⇒ Object
readonly
Returns the value of attribute glossary.
-
#groups ⇒ Object
readonly
Returns the value of attribute groups.
-
#users ⇒ Object
readonly
Returns the value of attribute users.
Instance Method Summary collapse
-
#initialize(glossary:, account: nil, groups: [], users: [], **_kwargs) ⇒ GlossaryShares
constructor
A new instance of GlossaryShares.
Methods inherited from Base
Constructor Details
#initialize(glossary:, account: nil, groups: [], users: [], **_kwargs) ⇒ GlossaryShares
Returns a new instance of GlossaryShares.
35 36 37 38 39 40 41 |
# File 'lib/lara/models/shares.rb', line 35 def initialize(glossary:, account: nil, groups: [], users: [], **_kwargs) super() @glossary = Glossary.new(**glossary.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.
33 34 35 |
# File 'lib/lara/models/shares.rb', line 33 def account @account end |
#glossary ⇒ Object (readonly)
Returns the value of attribute glossary.
33 34 35 |
# File 'lib/lara/models/shares.rb', line 33 def glossary @glossary end |
#groups ⇒ Object (readonly)
Returns the value of attribute groups.
33 34 35 |
# File 'lib/lara/models/shares.rb', line 33 def groups @groups end |
#users ⇒ Object (readonly)
Returns the value of attribute users.
33 34 35 |
# File 'lib/lara/models/shares.rb', line 33 def users @users end |