Class: Sevgi::Graphics::Content

Inherits:
Object
  • Object
show all
Defined in:
lib/sevgi/graphics/auxilary/content.rb

Direct Known Subclasses

CData, CSS, Encoded, Verbatim

Defined Under Namespace

Classes: CData, CSS, Encoded, Verbatim

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content) ⇒ Content

Returns a new instance of Content.



8
# File 'lib/sevgi/graphics/auxilary/content.rb', line 8

def initialize(content)     = @content = content

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



6
7
8
# File 'lib/sevgi/graphics/auxilary/content.rb', line 6

def content
  @content
end

Class Method Details

.cdataObject



15
# File 'lib/sevgi/graphics/auxilary/content.rb', line 15

def cdata(...)            = CData.new(...)

.cssObject



17
# File 'lib/sevgi/graphics/auxilary/content.rb', line 17

def css(...)              = CSS.new(...)

.encodedObject



19
# File 'lib/sevgi/graphics/auxilary/content.rb', line 19

def encoded(...)          = Encoded.new(...)

.text(contents) ⇒ Object



21
# File 'lib/sevgi/graphics/auxilary/content.rb', line 21

def text(contents)        = Array(contents).map(&:to_s).join("\n")

.verbatimObject



23
# File 'lib/sevgi/graphics/auxilary/content.rb', line 23

def verbatim(...)         = Verbatim.new(...)

Instance Method Details

#render(renderer, depth) ⇒ Object

Raises:

  • (NoMethodError)


10
# File 'lib/sevgi/graphics/auxilary/content.rb', line 10

def render(renderer, depth) = raise(NoMethodError, "#{self.class}#render must be implemented")

#to_sObject



12
# File 'lib/sevgi/graphics/auxilary/content.rb', line 12

def to_s                    = content.to_s