class Seeren::ViewConfig

Attributes

css[R]
js[R]
view[R]

Public Class Methods

new(args={}) click to toggle source
# File lib/seeren/view_config.rb, line 4
def initialize(args={})
  args.each do |key, value|
    self.public_send "#{key}=", value
  end
end

Public Instance Methods

contain_in() click to toggle source
# File lib/seeren/view_config.rb, line 10
def contain_in
  style = ""
  style += "width:#{@width};" if @width
  style += "height:#{@height};" if @height
  style
end

Private Instance Methods

validate_size(value) click to toggle source
# File lib/seeren/view_config.rb, line 32
def validate_size(value)
  if value and not (value =~ /[\d\.]+(px|em)/)
    fail Seeren::InvalidFormat
  end
end