Class: UEncode::Overlay

Inherits:
Object
  • Object
show all
Includes:
AttrSetting
Defined in:
lib/uencode/elements.rb

Constant Summary collapse

ATTRIBUTES =
[:quadrant]

Instance Method Summary collapse

Methods included from AttrSetting

included, #initialize, #set_attributes

Instance Method Details

#positionObject



112
113
114
# File 'lib/uencode/elements.rb', line 112

def position
  @position
end

#position=(_position) ⇒ Object



107
108
109
110
# File 'lib/uencode/elements.rb', line 107

def position=(_position)
  _position = Position.new(_position) unless _position.instance_of?(Position) || _position.nil?
  instance_variable_set :@position, _position
end

#source_imageObject



121
122
123
# File 'lib/uencode/elements.rb', line 121

def source_image
  @source_image
end

#source_image=(_source) ⇒ Object



116
117
118
119
# File 'lib/uencode/elements.rb', line 116

def source_image=(_source)
   _source = OverlayUrl.new(_source) unless _source.instance_of?(OverlayUrl) || _source.nil?
   instance_variable_set :@source_image, _source
end

#to_xmlObject



125
126
127
128
129
130
131
132
133
# File 'lib/uencode/elements.rb', line 125

def to_xml
  %Q{
    <overlay>
      #{!source_image.nil? ? source_image.to_xml : ""}
      #{!@position.nil? ? @position.to_xml : ""}
      #{!quadrant.nil? ? '<quadrant>' + quadrant.to_s + '</quadrant>' : ""}
    </overlay>
  }
end