Class: UnderOs::UI::View

Inherits:
Object
  • Object
show all
Includes:
Animation, Commons, Dimensions, Events, Manipulation, Styles, Traversing, Wrap
Defined in:
lib/under_os/ui/view.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ View

Returns a new instance of View.



13
14
15
16
17
18
19
# File 'lib/under_os/ui/view.rb', line 13

def initialize(options={})
  self.id        = options.delete(:id)    if options.has_key?(:id)
  self.className = options.delete(:class) if options.has_key?(:class)
  self.style     = options.delete(:style) if options.has_key?(:style)
  self.on        = options.delete(:on)    if options.has_key?(:on)
  self.data      = options.delete(:data)  if options.has_key?(:data)
end

Instance Method Details

#inspectObject



21
22
23
24
25
26
27
28
29
30
# File 'lib/under_os/ui/view.rb', line 21

def inspect
  params = {tag: tagName}
  params[:id]    = id if id
  params[:class] = className unless classNames.empty?
  params = params.map do |key, value|
    "#{key}=\"#{value}\""
  end

  "#<#{self.class.name} #{params.join(" ")}>"
end