class RubyPager::Image_Data
Attributes
file_name[R]
height[R]
width[R]
Public Class Methods
blank_data()
click to toggle source
# File lib/ruby_pager/image_data.rb, line 32 def self.blank_data res=Hash.new res["@imageFilename"]="" res["@imageWidth"]="0" res["@imageHeight"]="0" return res end
new(ex_data)
click to toggle source
# File lib/ruby_pager/image_data.rb, line 7 def initialize(ex_data) @data=Hash.new @data["@imageFilename"]=ex_data["@imageFilename"] @data["@imageWidth"]=ex_data["@imageWidth"] @data["@imageHeight"]=ex_data["@imageHeight"] @file_name = @data["@imageFilename"] @width = @data["@imageWidth"].to_i @height = @data["@imageHeight"].to_i end
Public Instance Methods
file_name=(ex_file_name)
click to toggle source
# File lib/ruby_pager/image_data.rb, line 17 def file_name= (ex_file_name) raise(ArgumentError, "Got passed a non string object") if ex_file_name.class != String @file_name=ex_file_name end
get_consolidated_data()
click to toggle source
# File lib/ruby_pager/image_data.rb, line 40 def get_consolidated_data consolidate_data() return @data end
height=(ex_height)
click to toggle source
# File lib/ruby_pager/image_data.rb, line 27 def height=(ex_height) raise(ArgumentError, "Got passed a non integer object") if ex_height.class != Fixnum or ex_height < 0 @height=ex_height end
width=(ex_width)
click to toggle source
# File lib/ruby_pager/image_data.rb, line 22 def width=(ex_width) raise(ArgumentError, "Got passed a non integer object") if ex_width.class != Fixnum or ex_width < 0 @width=ex_width end
Private Instance Methods
consolidate_data()
click to toggle source
# File lib/ruby_pager/image_data.rb, line 47 def consolidate_data() @data["@imageFilename"]=@file_name @data["@imageWidth"]=@width.to_s @data["@imageHeight"]=@height.to_s end