Class: RubyPager::Image_Data

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_pager/image_data.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ex_data) ⇒ Image_Data

Returns a new instance of Image_Data.



7
8
9
10
11
12
13
14
15
# 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

Instance Attribute Details

#file_nameObject

Returns the value of attribute file_name.



6
7
8
# File 'lib/ruby_pager/image_data.rb', line 6

def file_name
  @file_name
end

#heightObject

Returns the value of attribute height.



6
7
8
# File 'lib/ruby_pager/image_data.rb', line 6

def height
  @height
end

#widthObject

Returns the value of attribute width.



6
7
8
# File 'lib/ruby_pager/image_data.rb', line 6

def width
  @width
end

Class Method Details

.blank_dataObject



32
33
34
35
36
37
38
# 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

Instance Method Details

#get_consolidated_dataObject



40
41
42
43
# File 'lib/ruby_pager/image_data.rb', line 40

def get_consolidated_data
  consolidate_data()
  return @data
end