Class: Coarnotify::Patterns::RequestReview

Inherits:
Core::Notify::NotifyPattern show all
Defined in:
lib/coarnotify/patterns/request_review.rb

Overview

Pattern to represent a Request Review notification coar-notify.net/specification/1.0.0/request-review/

Instance Attribute Summary

Attributes inherited from Core::Notify::NotifyBase

#properties_by_reference, #validate_properties, #validate_stream_on_construct, #validators

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Core::Notify::NotifyPattern

#actor, #actor=, #context, #context=, #ensure_type_contains, #in_reply_to, #in_reply_to=, #initialize, #object=, #origin, #origin=, #target, #target=, #validate

Methods inherited from Core::Notify::NotifyBase

#doc, #get_property, #id, #id=, #initialize, #optional_and_validate, #register_property_validation_error, #required, #required_and_validate, #set_property, #to_jsonld, #type, #type=, #validate, #validate_property

Constructor Details

This class inherits a constructor from Coarnotify::Core::Notify::NotifyPattern

Class Method Details

.type_constantObject

Request Review types, including an ActivityStreams offer and a COAR Notify Review Action



13
14
15
# File 'lib/coarnotify/patterns/request_review.rb', line 13

def self.type_constant
  [Core::ActivityStreams2::ActivityStreamsTypes::OFFER, Core::Notify::NotifyTypes::REVIEW_ACTION]
end

Instance Method Details

#objectRequestReviewObject?

Custom getter to retrieve the object property as a RequestReviewObject

Returns:



20
21
22
23
24
25
26
27
28
# File 'lib/coarnotify/patterns/request_review.rb', line 20

def object
  o = get_property(Core::ActivityStreams2::Properties::OBJECT)
  if o
    RequestReviewObject.new(stream: o, validate_stream_on_construct: false,
                            validate_properties: @validate_properties, validators: @validators,
                            validation_context: Core::ActivityStreams2::Properties::OBJECT,
                            properties_by_reference: @properties_by_reference)
  end
end