class SugarPNG::Border
Attributes
bottom[RW]
color[RW]
left[RW]
right[RW]
top[RW]
Public Class Methods
new(h)
click to toggle source
# File lib/sugar_png/border.rb, line 4 def initialize h @color = h[:color] || raise(ArgumentError.new("border color must be set")) @left = (h[:left] || h[:size]).to_i @right = (h[:right] || h[:size]).to_i @top = (h[:top] || h[:size]).to_i @bottom= (h[:bottom]|| h[:size]).to_i end
Public Instance Methods
height()
click to toggle source
# File lib/sugar_png/border.rb, line 16 def height @top + @bottom end
width()
click to toggle source
# File lib/sugar_png/border.rb, line 12 def width @left + @right end