File: describable.rb

package info (click to toggle)
ruby-rmagick 6.0.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,232 kB
  • sloc: cpp: 19,563; ruby: 17,147; sh: 88; javascript: 36; makefile: 13
file content (47 lines) | stat: -rw-r--r-- 1,177 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#--
# $Id: describable.rb,v 1.5 2009/02/28 23:52:13 rmagick Exp $
# Copyright (C) 2009 Timothy P. Hunter
#++
module Magick
  class RVG
    #--
    # Corresponds to SVG's Description.class
    #++
    # This module defines a number of metadata attributes.
    module Describable
      private

      def initialize(*args, &block)
        super
        @title, @desc, @metadata = nil
      end

      public

      # Sets the object description
      attr_writer :desc
      # Sets the object title
      attr_writer :title
      # Sets the object metadata
      attr_writer :metadata

      # Returns the title of this object. The RVG object title is stored as
      # the 'title' property on the image
      def title
        @title.to_s
      end

      # Returns the description of this object. The RVG object description is
      # stored as the 'desc' property on the image
      def desc
        @desc.to_s
      end

      # Returns additional metadata of this object. The RVG object metadata
      # are stored as the 'metadata' property on the image
      def metadata
        @metadata.to_s
      end
    end # module Describable
  end # class RVG
end # module Magick