Class: ActivityProvider::LRS::Group

Inherits:
Base
  • Object
show all
Defined in:
lib/activity_provider/lrs/group.rb

Instance Method Summary collapse

Methods inherited from Base

#to_json, #validate!

Constructor Details

#initialize(args) ⇒ Group

Returns a new instance of Group.



9
10
11
12
# File 'lib/activity_provider/lrs/group.rb', line 9

def initialize(args)
  @object_type = 'Group'
  super
end

Instance Method Details

#as_json(*_args) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/activity_provider/lrs/group.rb', line 14

def as_json(*_args)
  dumped_hash = { objectType: @object_type }
  dumped_hash[:name] = @name if @name
  dumped_hash[:member] = @members if @members && !@members.empty?
  dumped_hash.merge!(@identifier.as_json)
  dumped_hash
end