Skip to content

Commit

Permalink
Fixed ActivityDefinition initialization issue
Browse files Browse the repository at this point in the history
  • Loading branch information
kibenimatik committed Mar 30, 2017
1 parent 98d3ff0 commit ddc6010
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/tin_can_api/activity_definition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,35 +29,35 @@ def initialize(options={}, &block)
if attributes['choices']
self.choices = []
attributes['choices'].each do |choice|
choices << InteractionComponent.new(choice.to_json)
choices << InteractionComponent.new(json: choice.to_json)
end
end

if attributes['scale']
self.scale = []
attributes['scale'].each do |element|
scale << InteractionComponent.new(element.to_json)
scale << InteractionComponent.new(json: element.to_json)
end
end

if attributes['source']
self.source = []
attributes['source'].each do |element|
source << InteractionComponent.new(element.to_json)
source << InteractionComponent.new(json: element.to_json)
end
end

if attributes['target']
self.target = []
attributes['target'].each do |element|
target << InteractionComponent.new(element.to_json)
target << InteractionComponent.new(json: element.to_json)
end
end

if attributes['steps']
self.steps = []
attributes['steps'].each do |element|
steps << InteractionComponent.new(element.to_json)
steps << InteractionComponent.new(json: element.to_json)
end
end

Expand Down

0 comments on commit ddc6010

Please sign in to comment.