Class: Vedeu::Interface

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/vedeu/models/interface.rb

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Interface

Returns a new instance of Interface.



9
10
11
# File 'lib/vedeu/models/interface.rb', line 9

def initialize(attributes = {})
  @attributes = attributes
end

Instance Method Details

#attributesObject



13
14
15
# File 'lib/vedeu/models/interface.rb', line 13

def attributes
  defaults.merge!(@attributes)
end

#colourObject



29
30
31
# File 'lib/vedeu/models/interface.rb', line 29

def colour
  @colour ||= Colour.new(attributes[:colour])
end

#cursorObject



41
42
43
# File 'lib/vedeu/models/interface.rb', line 41

def cursor
  @cursor ||= attributes[:cursor]
end

#delayObject



45
46
47
# File 'lib/vedeu/models/interface.rb', line 45

def delay
  @delay || attributes[:delay]
end

#geometryObject



37
38
39
# File 'lib/vedeu/models/interface.rb', line 37

def geometry
  @geometry ||= Geometry.new(attributes[:geometry])
end

#groupObject



21
22
23
# File 'lib/vedeu/models/interface.rb', line 21

def group
  @group ||= attributes[:group]
end

#linesObject



25
26
27
# File 'lib/vedeu/models/interface.rb', line 25

def lines
  @lines ||= Attributes.coercer(attributes[:lines], Line, :streams)
end

#nameObject



17
18
19
# File 'lib/vedeu/models/interface.rb', line 17

def name
  @name ||= attributes[:name]
end

#styleObject



33
34
35
# File 'lib/vedeu/models/interface.rb', line 33

def style
  @style ||= Attributes.coerce_styles(attributes[:style])
end

#to_sObject



49
50
51
# File 'lib/vedeu/models/interface.rb', line 49

def to_s
  Render.call(self)
end