ims_caliper 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. checksums.yaml +8 -8
  2. data/.gitignore +37 -0
  3. data/.idea/caliper-ruby.iml +98 -0
  4. data/.idea/encodings.xml +5 -0
  5. data/.idea/misc.xml +5 -0
  6. data/.idea/modules.xml +9 -0
  7. data/.idea/scopes/scope_settings.xml +5 -0
  8. data/.idea/vcs.xml +7 -0
  9. data/Gemfile +12 -1
  10. data/Gemfile.lock +42 -1
  11. data/LICENSE +67 -0
  12. data/NOTICE +15 -0
  13. data/README.md +13 -5
  14. data/caliper.gemspec +2 -8
  15. data/lib/caliper/defaults.rb +4 -4
  16. data/lib/caliper/entities/annotation/annotation.rb +14 -4
  17. data/lib/caliper/entities/annotation/bookmark_annotation.rb +14 -4
  18. data/lib/caliper/entities/annotation/highlight_annotation.rb +14 -3
  19. data/lib/caliper/entities/annotation/shared_annotation.rb +12 -3
  20. data/lib/caliper/entities/annotation/tag_annotation.rb +13 -3
  21. data/lib/caliper/entities/assessment/assessment.rb +27 -0
  22. data/lib/caliper/entities/assessment/assessment_item.rb +26 -0
  23. data/lib/caliper/entities/assignable/assignable_digital_resource.rb +47 -0
  24. data/lib/caliper/entities/assignable/attempt.rb +32 -0
  25. data/lib/caliper/entities/digital_resource.rb +36 -35
  26. data/lib/caliper/entities/entity.rb +50 -36
  27. data/lib/caliper/entities/foaf/agent.rb +1 -1
  28. data/lib/caliper/entities/jsonable.rb +56 -0
  29. data/lib/caliper/entities/learning_objective.rb +26 -0
  30. data/lib/caliper/entities/lis/course_offering.rb +30 -0
  31. data/lib/caliper/entities/lis/course_section.rb +27 -15
  32. data/lib/caliper/entities/lis/group.rb +27 -0
  33. data/lib/caliper/entities/lis/membership.rb +32 -0
  34. data/lib/caliper/entities/lis/organization.rb +20 -17
  35. data/lib/caliper/entities/lis/person.rb +23 -10
  36. data/lib/caliper/entities/lis/roles.rb +77 -0
  37. data/lib/caliper/entities/lis/status.rb +19 -0
  38. data/lib/caliper/entities/media/audio_object.rb +21 -0
  39. data/lib/caliper/entities/media/image_object.rb +21 -0
  40. data/lib/caliper/entities/media/media_location.rb +23 -0
  41. data/lib/caliper/entities/media/media_object.rb +38 -0
  42. data/lib/caliper/entities/media/video_object.rb +21 -0
  43. data/lib/caliper/entities/reading/epub_volume.rb +15 -7
  44. data/lib/caliper/entities/reading/frame.rb +7 -15
  45. data/lib/caliper/entities/response/fillin_blank_response.rb +20 -0
  46. data/lib/caliper/entities/response/multiple_choice_response.rb +20 -0
  47. data/lib/caliper/entities/response/multiple_response_response.rb +20 -0
  48. data/lib/caliper/entities/response/response.rb +23 -0
  49. data/lib/caliper/entities/response/response_type.rb +13 -0
  50. data/lib/caliper/entities/response/select_type_response.rb +20 -0
  51. data/lib/caliper/entities/response/true_false_response.rb +21 -0
  52. data/lib/caliper/entities/schemadotorg/software_application.rb +8 -8
  53. data/lib/caliper/entities/session.rb +25 -17
  54. data/lib/caliper/entities/software_application.rb +16 -7
  55. data/lib/caliper/entities/web_page.rb +2 -0
  56. data/lib/caliper/entity_envelope.rb +21 -0
  57. data/lib/caliper/event/annotation_event.rb +10 -6
  58. data/lib/caliper/event/assessment_event.rb +19 -0
  59. data/lib/caliper/event/assessment_item_event.rb +19 -0
  60. data/lib/caliper/event/assignable_event.rb +19 -0
  61. data/lib/caliper/event/event.rb +70 -50
  62. data/lib/caliper/event/jsonable.rb +55 -0
  63. data/lib/caliper/event/navigation_event.rb +2 -7
  64. data/lib/caliper/event/outcome_event.rb +1 -1
  65. data/lib/caliper/event/session_event.rb +13 -14
  66. data/lib/caliper/event/view_event.rb +6 -7
  67. data/lib/caliper/event_envelope.rb +22 -0
  68. data/lib/caliper/jsonable.rb +53 -0
  69. data/lib/caliper/profiles/annotation_profile.rb +56 -53
  70. data/lib/caliper/profiles/assessment_profile.rb +48 -0
  71. data/lib/caliper/profiles/assignable_profile.rb +44 -0
  72. data/lib/caliper/profiles/media_profile.rb +54 -0
  73. data/lib/caliper/profiles/profile.rb +38 -38
  74. data/lib/caliper/profiles/reading_profile.rb +31 -28
  75. data/lib/caliper/profiles/session_profile.rb +17 -18
  76. data/lib/caliper/request/event_store_requestor.rb +26 -26
  77. data/lib/caliper/sensor.rb +46 -35
  78. data/lib/caliper/version.rb +1 -1
  79. data/spec/lib/entities/entity.json +9 -0
  80. data/spec/lib/entities/entity_spec.rb +37 -0
  81. data/spec/lib/entities/lis/person_spec.rb +37 -0
  82. data/spec/lib/entities/lis/student.json +11 -0
  83. data/spec/lib/event/annotation_event_bookmark_spec.rb +159 -0
  84. data/spec/lib/event/annotation_event_highlight_spec.rb +160 -0
  85. data/spec/lib/event/annotation_event_shared_spec.rb +172 -0
  86. data/spec/lib/event/annotation_event_tag_spec.rb +159 -0
  87. data/spec/lib/event/assessment_event_spec.rb +207 -0
  88. data/spec/lib/event/assessment_item_completed_event_spec.rb +223 -0
  89. data/spec/lib/event/assessment_item_started_event_spec.rb +207 -0
  90. data/spec/lib/event/media_event_spec.rb +157 -0
  91. data/spec/lib/event/navigated_event_spec.rb +160 -0
  92. data/spec/lib/event/session_event_login_spec.rb +160 -0
  93. data/spec/lib/event/session_event_logout_spec.rb +145 -0
  94. data/spec/lib/event/session_event_timeout_spec.rb +145 -0
  95. data/spec/lib/event/viewed_event_spec.rb +149 -0
  96. data/spec/lib/event_helper.rb +145 -0
  97. data/spec/lib/sensor_spec.rb +30 -0
  98. data/spec/spec_helper.rb +3 -2
  99. metadata +84 -61
  100. data/lib/caliper/client.rb +0 -33
  101. data/lib/caliper/consumer/base.rb +0 -46
  102. data/lib/caliper/consumer/queue.rb +0 -40
  103. data/lib/caliper/consumer/socket.rb +0 -132
  104. data/lib/caliper/entities/annotation/text_position_selector.rb +0 -14
  105. data/lib/caliper/entities/schemadotorg/audio_object.rb +0 -15
  106. data/lib/caliper/entities/schemadotorg/image_object.rb +0 -15
  107. data/lib/caliper/entities/schemadotorg/media_object.rb +0 -19
  108. data/lib/caliper/entities/schemadotorg/video_object.rb +0 -15
  109. data/lib/caliper/event/.shared.rb.swp +0 -0
  110. data/spec/lib/client_spec.rb +0 -35
  111. data/spec/lib/consumer/base_spec.rb +0 -28
  112. data/spec/lib/consumer/queue_spec.rb +0 -16
  113. data/spec/lib/event/annotation_spec.rb +0 -12
  114. data/spec/lib/event/bookmarked_spec.rb +0 -17
  115. data/spec/lib/event/commented_spec.rb +0 -19
  116. data/spec/lib/event/highlighted_spec.rb +0 -18
  117. data/spec/lib/event/navigation_spec.rb +0 -15
  118. data/spec/lib/event/shared_spec.rb +0 -18
  119. data/spec/lib/event/tagged_spec.rb +0 -17
  120. data/spec/lib/event/used_spec.rb +0 -15
  121. data/spec/lib/event/viewed_spec.rb +0 -15
  122. data/test/caliper/events/session_login_event_test.rb +0 -58
  123. data/test/caliper/events/session_logout_event_test.rb +0 -55
  124. data/test/caliper/events/session_timeout_event_test.rb +0 -55
  125. data/test/caliper/request/http_requestor_test.rb +0 -59
  126. data/test/caliper/test_event.rb +0 -53
  127. data/test/caliper/test_utils.rb +0 -198
  128. data/test/fixtures/caliper_session_login_event.json +0 -71
  129. data/test/fixtures/caliper_session_logout_event.json +0 -52
  130. data/test/fixtures/caliper_session_timeout_event.json +0 -52
  131. data/test/fixtures/event_store_payload.json +0 -85
@@ -1,16 +1,26 @@
1
1
  require_relative 'annotation'
2
2
 
3
+ #
4
+ #
5
+ # @copyright @copyright ©2013 IMS Global Learning Consortium, Inc. All Rights Reserved.
6
+ # @license For license information contact, info@imsglobal.org
7
+ #
8
+ #
9
+ # Bookmark Annotation Entity
10
+ #
3
11
  module Caliper
4
12
  module Entities
5
13
  module Annotation
6
- class Bookmark < Annotation
7
- attr_accessor :type,
8
- :bookmark_notes
9
14
 
10
- def initialize(action)
15
+ class BookmarkAnnotation < Annotation
16
+ attr_accessor :bookmarkNotes
17
+
18
+ def initialize
11
19
  super
12
20
  @type = AnnotationType::BOOKMARK_ANNOTATION
21
+ @bookmarkNotes = nil
13
22
  end
23
+
14
24
  end
15
25
  end
16
26
  end
@@ -1,17 +1,28 @@
1
1
  require_relative 'annotation'
2
2
 
3
+ #
4
+ #
5
+ # @copyright @copyright ©2013 IMS Global Learning Consortium, Inc. All Rights Reserved.
6
+ # @license For license information contact, info@imsglobal.org
7
+ #
8
+ #
9
+ # Hilight Annotation Entity
10
+ #
3
11
  module Caliper
4
12
  module Entities
5
13
  module Annotation
14
+
6
15
  class HighlightAnnotation < Annotation
7
- attr_accessor :type,
8
- :bookmark_notes
16
+ attr_accessor :selectionText,
17
+ :selection
9
18
 
10
19
  def initialize()
11
20
  super
12
21
  @type = AnnotationType::HIGHLIGHT_ANNOTATION
13
- @bookmark_notes = ''
22
+ @selectionText = nil
23
+ @selection = {}
14
24
  end
25
+
15
26
  end
16
27
  end
17
28
  end
@@ -1,17 +1,26 @@
1
1
  require_relative 'annotation'
2
2
 
3
+ #
4
+ #
5
+ # @copyright @copyright ©2013 IMS Global Learning Consortium, Inc. All Rights Reserved.
6
+ # @license For license information contact, info@imsglobal.org
7
+ #
8
+ #
9
+ # Shared Annotation Entity
10
+ #
3
11
  module Caliper
4
12
  module Entities
5
13
  module Annotation
14
+
6
15
  class SharedAnnotation < Annotation
7
- attr_accessor :with_agents, # list of Agent object
8
- :type
16
+ attr_accessor :withAgents # list of Agent objects
9
17
 
10
18
  def initialize()
11
19
  super
12
20
  @type = AnnotationType::SHARED_ANNOTATION
13
- @with_agents = ''
21
+ @withAgents = Array.new
14
22
  end
23
+
15
24
  end
16
25
  end
17
26
  end
@@ -1,16 +1,26 @@
1
- require_relative 'Annotation'
1
+ require_relative 'annotation'
2
2
 
3
+ #
4
+ #
5
+ # @copyright @copyright ©2013 IMS Global Learning Consortium, Inc. All Rights Reserved.
6
+ # @license For license information contact, info@imsglobal.org
7
+ #
8
+ #
9
+ # Tag Annotation Entity
10
+ #
3
11
  module Caliper
4
12
  module Entities
5
13
  module Annotation
14
+
6
15
  class TagAnnotation < Annotation
7
- attr_accessor :type,
8
- :tags
16
+ attr_accessor :tags
9
17
 
10
18
  def initialize()
11
19
  super
12
20
  @type = AnnotationType::TAG_ANNOTATION
21
+ @tags = Array.new
13
22
  end
23
+
14
24
  end
15
25
  end
16
26
  end
@@ -0,0 +1,27 @@
1
+ require_relative '../../entities/assignable/assignable_digital_resource'
2
+
3
+ #
4
+ #
5
+ # @copyright @copyright ©2013 IMS Global Learning Consortium, Inc. All Rights Reserved.
6
+ # @license For license information contact, info@imsglobal.org
7
+ #
8
+ # Represents an Assessment
9
+ #
10
+
11
+ module Caliper
12
+ module Entities
13
+ module Assessment
14
+
15
+ class Assessment < Caliper::Entities::Assignable::AssignableDigitalResource
16
+
17
+ attr_accessor :assessmentItems
18
+
19
+ def initialize
20
+ super
21
+ @type = Caliper::Entities::Assignable::AssignableDigitalResourceType::ASSESSMENT
22
+ end
23
+
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,26 @@
1
+ require_relative '../../entities/assignable/assignable_digital_resource'
2
+
3
+ #
4
+ # @copyright @copyright ©2013 IMS Global Learning Consortium, Inc. All Rights Reserved.
5
+ # @license For license information contact, info@imsglobal.org
6
+ #
7
+ # Represents an Assessment Item.
8
+ #
9
+
10
+ module Caliper
11
+ module Entities
12
+ module Assessment
13
+
14
+ class AssessmentItem < Caliper::Entities::Assignable::AssignableDigitalResource
15
+
16
+ attr_accessor :isTimeDependent
17
+
18
+ def initialize
19
+ super
20
+ @type = Caliper::Entities::Assignable::AssignableDigitalResourceType::ASSESSMENT_ITEM
21
+ end
22
+
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,47 @@
1
+ require_relative '../../entities/digital_resource'
2
+ require_relative '../../entities/schemadotorg/thing'
3
+
4
+ #
5
+ # @copyright @copyright ©2013 IMS Global Learning Consortium, Inc. All Rights Reserved.
6
+ # @license For license information contact, info@imsglobal.org
7
+ #
8
+ # Represents AssignableDigitalResource.
9
+ # AssignableDigitalResource's prototype set to DigitalResource
10
+ #
11
+
12
+ module Caliper
13
+ module Entities
14
+ module Assignable
15
+
16
+ module AssignableDigitalResourceType
17
+ ASSESSMENT = "http://purl.imsglobal.org/caliper/v1/Assessment"
18
+ ASSESSMENT_ITEM = "http://purl.imsglobal.org/caliper/v1/AssessmentItem"
19
+ end
20
+
21
+ class AssignableDigitalResource < DigitalResource
22
+ include Caliper::Entities::SchemaDotOrg::Thing
23
+
24
+ attr_accessor :dateToActivate,
25
+ :dateToShow,
26
+ :dateToStartOn,
27
+ :dateToSubmit,
28
+ :maxAttempts,
29
+ :maxSubmits,
30
+ :maxScore
31
+
32
+ def initialize
33
+ super
34
+ @type = DigitalResourceType::ASSIGNABLE_DIGITAL_RESOURCE
35
+ @dateToActivate = nil
36
+ @dateToShow = nil
37
+ @dateToStartOn = nil
38
+ @dateToSubmit = nil
39
+ @maxAttempts = nil
40
+ @maxSubmits = nil
41
+ @maxScore = nil
42
+ end
43
+
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,32 @@
1
+ require_relative '../../entities/entity'
2
+
3
+ #
4
+ # @copyright @copyright ©2013 IMS Global Learning Consortium, Inc. All Rights Reserved.
5
+ # @license For license information contact, info@imsglobal.org
6
+ #
7
+ #
8
+ # Represents an Attempt on an Assignable
9
+ #
10
+ module Caliper
11
+ module Entities
12
+ module Assignable
13
+
14
+ class Attempt < Entity
15
+
16
+ attr_accessor :assignable,
17
+ :actor,
18
+ :count,
19
+ :startedAtTime,
20
+ :endedAtTime,
21
+ :duration
22
+
23
+ def initialize
24
+ super
25
+ @type = EntityType::ATTEMPT
26
+ end
27
+
28
+ end
29
+
30
+ end
31
+ end
32
+ end
@@ -1,52 +1,53 @@
1
1
  require "json"
2
2
  require_relative 'entity'
3
3
 
4
+ #
5
+ #
6
+ # @copyright @copyright ©2013 IMS Global Learning Consortium, Inc. All Rights Reserved.
7
+ # @license For license information contact, info@imsglobal.org
8
+ #
4
9
  # Public: Caliper representation of a CreativeWork (https://schema.org/CreativeWork)
5
10
  # We add learning specific attributes, including a list of
6
11
  # LearningObjective learning objectives and a list of
7
12
  # String keywords
8
13
  #
9
- # Examples
10
- #
11
-
12
14
  module Caliper
13
15
  module Entities
14
- module DigitalResourceType
15
- ASSIGNABLE_DIGITAL_RESOURCE = "http://purl.imsglobal.org/caliper/v1/AssignableDigitalResource"
16
- EPUB_CHAPTER = "http://www.idpf.org/epub/vocab/structure/#chapter"
17
- EPUB_PART = "http://www.idpf.org/epub/vocab/structure/#part"
18
- EPUB_SUB_CHAPTER = "http://www.idpf.org/epub/vocab/structure/#subchapter"
19
- EPUB_VOLUME = "http://www.idpf.org/epub/vocab/structure/#volume"
20
- FRAME = "http://purl.imsglobal.org/caliper/v1/Frame"
21
- MEDIA_LOCATION = "http://purl.imsglobal.org/caliper/v1/MediaLocation"
22
- MEDIA_OBJECT = "http://purl.imsglobal.org/caliper/v1/MediaObject"
23
- READING = "http://www.idpf.org/epub/vocab/structure"
24
- WEB_PAGE = "http://purl.imsglobal.org/caliper/v1/WebPage"
25
- end
16
+
17
+ module DigitalResourceType
18
+ ASSIGNABLE_DIGITAL_RESOURCE = "http://purl.imsglobal.org/caliper/v1/AssignableDigitalResource"
19
+ EPUB_CHAPTER = "http://www.idpf.org/epub/vocab/structure/#chapter"
20
+ EPUB_PART = "http://www.idpf.org/epub/vocab/structure/#part"
21
+ EPUB_SUB_CHAPTER = "http://www.idpf.org/epub/vocab/structure/#subchapter"
22
+ EPUB_VOLUME = "http://www.idpf.org/epub/vocab/structure/#volume"
23
+ FRAME = "http://purl.imsglobal.org/caliper/v1/Frame"
24
+ MEDIA_LOCATION = "http://purl.imsglobal.org/caliper/v1/MediaLocation"
25
+ MEDIA_OBJECT = "http://purl.imsglobal.org/caliper/v1/MediaObject"
26
+ READING = "http://www.idpf.org/epub/vocab/structure"
27
+ WEB_PAGE = "http://purl.imsglobal.org/caliper/v1/WebPage"
28
+ end
29
+
26
30
  class DigitalResource < Entity
27
- attr_accessor :type,
28
- :object_types, # list of String
29
- :learning_objectives, # a list of learning objectives
30
- :keywords,
31
- :is_part_of,
32
- :date_published
31
+ include Caliper::Entities::Jsonable
32
+
33
+ attr_accessor :objectType,
34
+ :alignedLearningObjective,
35
+ :keywords,
36
+ :isPartOf,
37
+ :datePublished,
38
+ :version
33
39
 
34
- # Public:
35
- def to_json(*a)
36
- {
37
- "type" => @type,
38
- "objectTypes" => @object_types,
39
- "learningObjective" => @learning_objectives,
40
- "keywords" => @keywords,
41
- "isPartOf" => @is_part_of,
42
- "datePublished" => @date_published
43
- }.to_json(*a)
40
+ def initialize
41
+ super
42
+ @type = EntityType::DIGITAL_RESOURCE
43
+ @alignedLearningObjective = Array.new
44
+ @objectType = Array.new
45
+ @keywords = Array.new
46
+ @datePublished = nil
47
+ @isPartOf = nil
48
+ @version = nil
44
49
  end
45
50
 
46
- def initialize()
47
- super
48
- @type = EntityType::DIGITAL_RESOURCE
49
- end
50
51
  end
51
52
  end
52
53
  end
@@ -1,44 +1,58 @@
1
- require "json"
2
-
3
- ##
4
- ## The base Caliper Entity. Analogous to a schema.org Thing.
5
- ##
1
+ require 'time'
2
+ require 'json'
3
+ require_relative './jsonable'
4
+ #
5
+ #
6
+ # @copyright @copyright ©2013 IMS Global Learning Consortium, Inc. All Rights Reserved.
7
+ # @license For license information contact, info@imsglobal.org
8
+ #
9
+ #
10
+ # The base Caliper Entity. Analogous to a schema.org Thing.
11
+ #
6
12
  module Caliper
7
13
  module Entities
8
- module EntityType
9
- AGENT = "http://purl.imsglobal.org/caliper/v1/Agent"
10
- ATTEMPT = "http://purl.imsglobal.org/caliper/v1/Attempt"
11
- DIGITAL_RESOURCE = "http://purl.imsglobal.org/caliper/v1/DigitalResource"
12
- ENTITY = "http://purl.imsglobal.org/caliper/v1/Entity"
13
- GENERATED = "http://purl.imsglobal.org/caliper/v1/Generated"
14
- LEARNING_OBJECTIVE = "http://purl.imsglobal.org/caliper/v1/LearningObjective"
15
- LIS_PERSON = "http://purl.imsglobal.org/caliper/v1/lis/Person"
16
- LIS_ORGANIZATION = "http://purl.imsglobal.org/caliper/v1/lis/Organization"
17
- RESULT = "http://purl.imsglobal.org/caliper/v1/Result"
18
- SESSION = "http://purl.imsglobal.org/caliper/v1/Session"
19
- SOFTWARE_APPLICATION = "http://purl.imsglobal.org/caliper/v1/SoftwareApplication"
20
- TARGET = "http://purl.imsglobal.org/caliper/v1/Target"
21
- VIEW = "http://purl.imsglobal.org/caliper/v1/View"
22
- end
14
+ module EntityType
15
+ AGENT = "http://purl.imsglobal.org/caliper/v1/Agent"
16
+ ATTEMPT = "http://purl.imsglobal.org/caliper/v1/Attempt"
17
+ DIGITAL_RESOURCE = "http://purl.imsglobal.org/caliper/v1/DigitalResource"
18
+ ENTITY = "http://purl.imsglobal.org/caliper/v1/Entity"
19
+ GENERATED = "http://purl.imsglobal.org/caliper/v1/Generated"
20
+ LEARNING_OBJECTIVE = "http://purl.imsglobal.org/caliper/v1/LearningObjective"
21
+ LIS_PERSON = "http://purl.imsglobal.org/caliper/v1/lis/Person"
22
+ # LIS_ORGANIZATION = "http://purl.imsglobal.org/caliper/v1/lis/Organization"
23
+ COURSE_OFFERING = "http://purl.imsglobal.org/caliper/v1/lis/CourseOffering"
24
+ COURSE_SECTION = "http://purl.imsglobal.org/caliper/v1/lis/CourseSection"
25
+ MEMBERSHIP = "http://purl.imsglobal.org/caliper/v1/lis/Membership"
26
+ ORGANIZATION = "http://purl.imsglobal.org/caliper/v1/w3c/Organization"
27
+ RESULT = "http://purl.imsglobal.org/caliper/v1/Result"
28
+ SESSION = "http://purl.imsglobal.org/caliper/v1/Session"
29
+ RESPONSE = "http://purl.imsglobal.org/caliper/v1/Response"
30
+ SOFTWARE_APPLICATION = "http://purl.imsglobal.org/caliper/v1/SoftwareApplication"
31
+ TARGET = "http://purl.imsglobal.org/caliper/v1/Target"
32
+ VIEW = "http://purl.imsglobal.org/caliper/v1/View"
33
+ end
23
34
 
24
35
  class Entity
25
- attr_accessor :id,
26
- :type,
27
- :name,
28
- :description,
29
- :properties,
30
- :date_created,
31
- :date_modified
36
+ include Caliper::Entities::Jsonable
37
+
38
+ attr_accessor :id,
39
+ :type,
40
+ :name,
41
+ :description,
42
+ :extensions,
43
+ :dateCreated,
44
+ :dateModified
45
+
46
+ def initialize()
47
+ @id = ""
48
+ @type = EntityType::ENTITY
49
+ @name = nil
50
+ @description = nil
51
+ @extensions = {}
52
+ @dateCreated = Time.now.utc.iso8601(3)
53
+ @dateModified = Time.now.utc.iso8601(3)
54
+ end
32
55
 
33
- def initialize()
34
- @id = ""
35
- @type = EntityType::ENTITY
36
- @name = ""
37
- @description = ""
38
- @properties = ""
39
- @date_created = Time.now.utc
40
- @date_modified = Time.now.utc
41
- end
42
56
  end
43
57
  end
44
58
  end