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|NilClass readonly
Instance Method Summary collapse
- #bx ⇒ Fixnum (also: #x)
- #bxn ⇒ Fixnum (also: #xn)
- #by ⇒ Fixnum (also: #y)
- #byn ⇒ Fixnum (also: #yn)
-
#enabled? ⇒ FalseClass
The null border should not be enabled, so that named geometry or null geometry is used.
-
#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.
- #null? ⇒ Boolean
- #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|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? ⇒ FalseClass
The null border should not be enabled, so that named geometry or null geometry is used.
52 53 54 |
# File 'lib/vedeu/borders/null.rb', line 52 def enabled? false end |
#geometry ⇒ Object (private)
Returns the geometry for the interface.
81 82 83 |
# File 'lib/vedeu/borders/null.rb', line 81 def geometry @geometry ||= Vedeu.geometries.by_name(name) end |
#height ⇒ Fixnum
57 58 59 |
# File 'lib/vedeu/borders/null.rb', line 57 def height (by..byn).size end |
#null? ⇒ Boolean
62 63 64 |
# File 'lib/vedeu/borders/null.rb', line 62 def null? true end |
#render ⇒ Array
67 68 69 |
# File 'lib/vedeu/borders/null.rb', line 67 def render [] end |
#width ⇒ Fixnum
72 73 74 |
# File 'lib/vedeu/borders/null.rb', line 72 def width (bx..bxn).size end |