Class: Vedeu::API::Line

Inherits:
Line
  • Object
show all
Includes:
Helpers
Defined in:
lib/vedeu/api/line.rb

Instance Method Summary collapse

Methods included from Helpers

#colour, #style

Methods inherited from Line

#attributes, build, #colour, #initialize, #streams, #style, #to_s

Constructor Details

This class inherits a constructor from Vedeu::Line

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Vedeu::Line

Instance Method Details

#background(value = '', &block) ⇒ Object



20
21
22
23
24
# File 'lib/vedeu/api/line.rb', line 20

def background(value = '', &block)
  attributes[:streams] << API::Stream.build({
                            colour: { background: value }
                          }, &block)
end

#foreground(value = '', &block) ⇒ Object



14
15
16
17
18
# File 'lib/vedeu/api/line.rb', line 14

def foreground(value = '', &block)
  attributes[:streams] << API::Stream.build({
                            colour: { foreground: value }
                          }, &block)
end

#stream(&block) ⇒ Object



6
7
8
# File 'lib/vedeu/api/line.rb', line 6

def stream(&block)
  attributes[:streams] << API::Stream.build(&block)
end

#text(value) ⇒ Object



10
11
12
# File 'lib/vedeu/api/line.rb', line 10

def text(value)
  attributes[:streams] << { text: value }
end