Class: Vedeu::Borders::Null
- Inherits:
-
Object
- Object
- Vedeu::Borders::Null
- Defined in:
- lib/vedeu/borders/null.rb
Overview
Provides a non-existent Vedeu::Borders::Border that acts like the real thing, but does nothing.
Instance Attribute Summary collapse
- #name ⇒ String|Symbol|NilClass readonly
Instance Method Summary collapse
- #bx ⇒ Fixnum (also: #x)
- #bxn ⇒ Fixnum (also: #xn)
- #by ⇒ Fixnum (also: #y)
- #byn ⇒ Fixnum (also: #yn)
- #enabled? ⇒ Boolean
-
#geometry ⇒ Object
private
Returns the geometry for the interface.
- #height ⇒ Fixnum
-
#initialize(attributes = {}) ⇒ Vedeu::Borders::Null
constructor
Returns a new instance of Vedeu::Borders::Null.
- #render ⇒ Array
- #width ⇒ Fixnum
Constructor Details
#initialize(attributes = {}) ⇒ Vedeu::Borders::Null
Returns a new instance of Vedeu::Borders::Null.
19 20 21 22 |
# File 'lib/vedeu/borders/null.rb', line 19 def initialize(attributes = {}) @attributes = attributes @name = @attributes[:name] end |
Instance Attribute Details
#name ⇒ String|Symbol|NilClass (readonly)
12 13 14 |
# File 'lib/vedeu/borders/null.rb', line 12 def name @name end |
Instance Method Details
#bx ⇒ Fixnum Also known as: x
25 26 27 |
# File 'lib/vedeu/borders/null.rb', line 25 def bx geometry.x end |
#bxn ⇒ Fixnum Also known as: xn
31 32 33 |
# File 'lib/vedeu/borders/null.rb', line 31 def bxn geometry.xn end |
#by ⇒ Fixnum Also known as: y
37 38 39 |
# File 'lib/vedeu/borders/null.rb', line 37 def by geometry.y end |
#byn ⇒ Fixnum Also known as: yn
43 44 45 |
# File 'lib/vedeu/borders/null.rb', line 43 def byn geometry.yn end |
#enabled? ⇒ Boolean
49 50 51 |
# File 'lib/vedeu/borders/null.rb', line 49 def enabled? false end |
#geometry ⇒ Object (private)
Returns the geometry for the interface.
73 74 75 |
# File 'lib/vedeu/borders/null.rb', line 73 def geometry @geometry ||= Vedeu.geometries.by_name(name) end |
#height ⇒ Fixnum
54 55 56 |
# File 'lib/vedeu/borders/null.rb', line 54 def height (by..byn).size end |
#render ⇒ Array
59 60 61 |
# File 'lib/vedeu/borders/null.rb', line 59 def render [] end |
#width ⇒ Fixnum
64 65 66 |
# File 'lib/vedeu/borders/null.rb', line 64 def width (bx..bxn).size end |