Sha256: 88a94b72e395638a6e24cbb6d9587702c54cbccbb8c8fd895b13f69e70f83c3c

Contents?: true

Size: 635 Bytes

Versions: 6

Compression:

Stored size: 635 Bytes

Contents

module Axlsx
  class GradientStop
    attr_accessor :color, :position
    def initialize(options={})
      raise ArugumentError, "postion is required" unless options[:position]
      raise ArugumentError, "color is required" unless options[:color]
      options.each do |o|
        self.send("#{o[0]}=", o[1]) if self.respond_to? o[0]
      end
    end
    def color=(v) raise ArgumentError, "#{v.inspect} is not a Axlsx::Color" unless v.is_a? Axlsx::Color; @color=v end
    def position=(v) Axlsx::validate_float v; @position = v end    
    def to_xml(xml) xml.stop(:position => self.position) {self.color.to_xml(xml)} end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
axlsx-1.0.7 lib/axlsx/stylesheet/gradient_stop.rb~
axlsx-1.0.6 lib/axlsx/stylesheet/gradient_stop.rb~
axlsx-1.0.5 lib/axlsx/stylesheet/gradient_stop.rb~
axlsx-1.0.4 lib/axlsx/stylesheet/gradient_stop.rb~
axlsx-1.0.3 lib/axlsx/stylesheet/gradient_stop.rb~
axlsx-1.0.1 lib/axlsx/stylesheet/gradient_stop.rb~