Class: GroupDocs::Document::Annotation::Reply
- Inherits:
-
Api::Entity
- Object
- Api::Entity
- GroupDocs::Document::Annotation::Reply
- Defined in:
- lib/groupdocs/document/annotation/reply.rb
Instance Attribute Summary collapse
- #annotation ⇒ Object
- #annotationGuid ⇒ Object (also: #annotation_guid)
- #guid ⇒ Object
- #repliedOn ⇒ Object (also: #replied_on)
- #text ⇒ Object
- #userGuid ⇒ Object (also: #user_guid)
- #userName ⇒ Object (also: #user_name)
Class Method Summary collapse
-
.get!(annotation, options = {}, access = {}) ⇒ Array<GroupDocs::Document::Annotation::Reply>
Return an array of replies for given annotation.
Instance Method Summary collapse
-
#create!(access = {}) ⇒ Object
Creates reply.
-
#edit!(access = {}) ⇒ Object
Edits reply.
-
#initialize(options = {}, &blk) ⇒ Reply
constructor
Creates new GroupDocs::Document::Annotation.
-
#remove!(access = {}) ⇒ Object
Removes reply.
Methods inherited from Api::Entity
Constructor Details
#initialize(options = {}, &blk) ⇒ Reply
Creates new GroupDocs::Document::Annotation.
72 73 74 75 76 |
# File 'lib/groupdocs/document/annotation/reply.rb', line 72 def initialize( = {}, &blk) super(, &blk) annotation.is_a?(GroupDocs::Document::Annotation) or raise ArgumentError, "You have to pass GroupDocs::Document::Annotation object: #{annotation.inspect}." end |
Instance Attribute Details
#annotation ⇒ Object
41 42 43 |
# File 'lib/groupdocs/document/annotation/reply.rb', line 41 def annotation @annotation end |
#annotationGuid ⇒ Object Also known as: annotation_guid
47 48 49 |
# File 'lib/groupdocs/document/annotation/reply.rb', line 47 def annotationGuid @annotationGuid end |
#guid ⇒ Object
45 46 47 |
# File 'lib/groupdocs/document/annotation/reply.rb', line 45 def guid @guid end |
#repliedOn ⇒ Object Also known as: replied_on
55 56 57 |
# File 'lib/groupdocs/document/annotation/reply.rb', line 55 def repliedOn @repliedOn end |
#text ⇒ Object
43 44 45 |
# File 'lib/groupdocs/document/annotation/reply.rb', line 43 def text @text end |
#userGuid ⇒ Object Also known as: user_guid
49 50 51 |
# File 'lib/groupdocs/document/annotation/reply.rb', line 49 def userGuid @userGuid end |
#userName ⇒ Object Also known as: user_name
51 52 53 |
# File 'lib/groupdocs/document/annotation/reply.rb', line 51 def userName @userName end |
Class Method Details
.get!(annotation, options = {}, access = {}) ⇒ Array<GroupDocs::Document::Annotation::Reply>
Return an array of replies for given annotation.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/groupdocs/document/annotation/reply.rb', line 18 def self.get!(annotation, = {}, access = {}) annotation.is_a?(GroupDocs::Document::Annotation) or raise ArgumentError, "You have to pass GroupDocs::Document::Annotation object: #{annotation.inspect}." ([:after] && ![:after].is_a?(Time)) and raise ArgumentError, "Option :after should be an instance of Time, received: #{[:after].inspect}" [:after] = ([:after].to_i * 1000) if [:after] api = Api::Request.new do |request| request[:access] = access request[:method] = :GET request[:path] = "/ant/{{client_id}}/annotations/#{annotation.guid}/replies" end api.add_params() json = api.execute! json[:replies].map do |reply| reply.merge!(annotation: annotation) Document::Annotation::Reply.new(reply) end end |
Instance Method Details
#create!(access = {}) ⇒ Object
Creates reply.
103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/groupdocs/document/annotation/reply.rb', line 103 def create!(access = {}) json = Api::Request.new do |request| request[:access] = access request[:method] = :POST request[:path] = "/ant/{{client_id}}/annotations/#{get_annotation_guid}/replies" request[:request_body] = text end.execute! self.guid = json[:replyGuid] self.annotation_guid = json[:annotationGuid] end |
#edit!(access = {}) ⇒ Object
Edits reply.
129 130 131 132 133 134 135 136 |
# File 'lib/groupdocs/document/annotation/reply.rb', line 129 def edit!(access = {}) Api::Request.new do |request| request[:access] = access request[:method] = :PUT request[:path] = "/ant/{{client_id}}/replies/#{guid}" request[:request_body] = text end.execute! end |
#remove!(access = {}) ⇒ Object
TODO:
currently not implemented in API
Removes reply.
147 148 149 150 151 152 153 |
# File 'lib/groupdocs/document/annotation/reply.rb', line 147 def remove!(access = {}) Api::Request.new do |request| request[:access] = access request[:method] = :DELETE request[:path] = "/ant/{{client_id}}/replies/#{guid}" end.execute! end |