Skip to content

Instantly share code, notes, and snippets.

@pyrabbit
Created November 30, 2017 17:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pyrabbit/c443ec72dc58b38c12385480529acd42 to your computer and use it in GitHub Desktop.
Save pyrabbit/c443ec72dc58b38c12385480529acd42 to your computer and use it in GitHub Desktop.
{
"Id"=>13730,
"ActivityId"=>12008,
"ActivityTypeId"=>4,
"ActivityTypeName"=>"Lab",
"ParentId"=>nil,
"Activities"=>[],
"Subtitle"=>"Virtual Server Connectivity Check, Module 01 Lab1",
"Description"=>
"In this lab you will discover the various components of the Lab On Demand (LOD) interface and learn how to interact with the controls to sucessfully complete your hands-on online labs.",
"Name"=>"Virtual Server Connectivity Check",
"AllowRetake"=>true,
"AllowReview"=>false,
"Url"=>nil,
"SortOrder"=>0,
"Required"=>false,
"AvailabilityTypeId"=>0,
"ExpectedDurationSeconds"=>0,
"IsExam"=>false
}
module LodService
class Activity
include ActiveModel::Serializers::JSON
attr_accessor :id
attr_accessor :activity_id
attr_accessor :activity_type_id
attr_accessor :activity_type_name
attr_accessor :parent_id
attr_accessor :activities
attr_accessor :subtitle
attr_accessor :description
attr_accessor :name
attr_accessor :allow_retake
attr_accessor :allow_review
attr_accessor :url
attr_accessor :sort_order
attr_accessor :required
attr_accessor :availability_type_id
attr_accessor :expected_duration_seconds
attr_accessor :is_exam
def attributes=(hash)
hash.each { |k,v| send("#{k.underscore}=", v) }
end
def attributes
instance_values
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment