Sha256: a941153456ae0e73a9369d546c554cd17ad6753b52750349949b3af611e70953
Contents?: true
Size: 719 Bytes
Versions: 12
Compression:
Stored size: 719 Bytes
Contents
module OpenX class Image include XMLRPC::Marshallable attr_accessor :filename, :content, :editswf def initialize(hash_or_file) @editswf = 0 if hash_or_file.is_a?(File) @filename = File.basename(hash_or_file.path) @editswf = File.basename(@filename, '.swf') == @filename ? 0 : 1 @content = XMLRPC::Base64.new(hash_or_file.read) else raise ArgumentError unless hash_or_file.key?(:filename) raise ArgumentError unless hash_or_file.key?(:content) hash_or_file.each { |k,v| send(:"#{k}=", v) } unless self.content.is_a?(XMLRPC::Base64) self.content = XMLRPC::Base64.new(self.content) end end end end end
Version data entries
12 entries across 12 versions & 6 rubygems