Class: Vedeu::Borders::Null

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Vedeu::Borders::Null

Returns a new instance of Vedeu::Borders::Null.

Options Hash (attributes):

  • name (String|Symbol|NilClass)


19
20
21
22
# File 'lib/vedeu/borders/null.rb', line 19

def initialize(attributes = {})
  @attributes = attributes
  @name       = @attributes[:name]
end

Instance Attribute Details

#nameString|Symbol|NilClass (readonly)



12
13
14
# File 'lib/vedeu/borders/null.rb', line 12

def name
  @name
end

Instance Method Details

#bxFixnum Also known as: x



25
26
27
# File 'lib/vedeu/borders/null.rb', line 25

def bx
  geometry.x
end

#bxnFixnum Also known as: xn



31
32
33
# File 'lib/vedeu/borders/null.rb', line 31

def bxn
  geometry.xn
end

#byFixnum Also known as: y



37
38
39
# File 'lib/vedeu/borders/null.rb', line 37

def by
  geometry.y
end

#bynFixnum 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

#geometryObject (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

#heightFixnum



54
55
56
# File 'lib/vedeu/borders/null.rb', line 54

def height
  (by..byn).size
end

#renderArray



59
60
61
# File 'lib/vedeu/borders/null.rb', line 59

def render
  []
end

#widthFixnum



64
65
66
# File 'lib/vedeu/borders/null.rb', line 64

def width
  (bx..bxn).size
end