Class: Uh::Layout::Screen

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
GeoAccessors
Defined in:
lib/uh/layout/screen.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, geo) ⇒ Screen

Returns a new instance of Screen.



12
13
14
15
16
# File 'lib/uh/layout/screen.rb', line 12

def initialize id, geo
  @id     = id
  @geo    = geo.dup
  @views  = Container.new [View.new(?1, @geo)]
end

Instance Attribute Details

#geoObject (readonly)

Returns the value of attribute geo.



10
11
12
# File 'lib/uh/layout/screen.rb', line 10

def geo
  @geo
end

#idObject (readonly)

Returns the value of attribute id.



10
11
12
# File 'lib/uh/layout/screen.rb', line 10

def id
  @id
end

#viewsObject (readonly)

Returns the value of attribute views.



10
11
12
# File 'lib/uh/layout/screen.rb', line 10

def views
  @views
end

Instance Method Details

#height=(value) ⇒ Object



22
23
24
25
# File 'lib/uh/layout/screen.rb', line 22

def height= value
  @geo.height = value
  @views.each { |view| view.height = value }
end

#include?(client) ⇒ Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/uh/layout/screen.rb', line 27

def include? client
  @views.any? { |view| view.include? client }
end

#to_sObject



18
19
20
# File 'lib/uh/layout/screen.rb', line 18

def to_s
  "SCREEN ##{@id}, geo: #{@geo}"
end