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
  @tags = Container.new([Tag.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

#tagsObject (readonly)

Returns the value of attribute tags.



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

def tags
  @tags
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
  @tags.each { |tag| tag.height = value }
end

#include?(client) ⇒ Boolean

Returns:

  • (Boolean)


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

def include?(client)
  @tags.any? { |tag| tag.include? client }
end

#to_sObject



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

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