class RestPki::PdfMarkImage

Attributes

resource[RW]

Public Class Methods

new(image_content=nil, mime_type=nil) click to toggle source
# File lib/rest_pki/pdf_mark_image.rb, line 5
def initialize(image_content=nil, mime_type=nil)
  @resource = ResourceContentOrReference.new
  unless image_content.nil?
    @resource.content = image_content
  end

  unless mime_type.nil?
    @resource.mime_type = mime_type
  end
end

Public Instance Methods

to_model() click to toggle source
# File lib/rest_pki/pdf_mark_image.rb, line 16
def to_model
  if @resource.content.nil? && @resource.url.nil?
    raise 'The image content was not set, neither its URL'
  end
  {
      resource: @resource.to_model
  }
end