Class: UI::Size
- Inherits:
-
Object
- Object
- UI::Size
- Defined in:
- lib/ektoplayer/ui.rb
Instance Attribute Summary collapse
-
#height ⇒ Object
Returns the value of attribute height.
-
#width ⇒ Object
Returns the value of attribute width.
Instance Method Summary collapse
- #==(s) ⇒ Object
- #calc(width: 0, height: 0) ⇒ Object
-
#initialize(width: 0, height: 0) ⇒ Size
constructor
A new instance of Size.
- #to_s ⇒ Object
- #update(width: nil, height: nil) ⇒ Object
Constructor Details
#initialize(width: 0, height: 0) ⇒ Size
Returns a new instance of Size.
232 233 234 |
# File 'lib/ektoplayer/ui.rb', line 232 def initialize(width: 0, height: 0) @width, @height = width, height end |
Instance Attribute Details
#height ⇒ Object
Returns the value of attribute height.
230 231 232 |
# File 'lib/ektoplayer/ui.rb', line 230 def height @height end |
#width ⇒ Object
Returns the value of attribute width.
230 231 232 |
# File 'lib/ektoplayer/ui.rb', line 230 def width @width end |
Instance Method Details
#==(s) ⇒ Object
244 |
# File 'lib/ektoplayer/ui.rb', line 244 def ==(s) s.height == @height and s.width == @width end |
#calc(width: 0, height: 0) ⇒ Object
240 241 242 |
# File 'lib/ektoplayer/ui.rb', line 240 def calc(width: 0, height: 0) Size.new(width: @width + width, height: @height + height) end |
#to_s ⇒ Object
245 |
# File 'lib/ektoplayer/ui.rb', line 245 def to_s; "[(Size) height=#{height}, width=#{width}]" end |