Class: Vedeu::Style

Inherits:
Object
  • Object
show all
Defined in:
lib/vedeu/models/style.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(values) ⇒ Style

Parameters:

  • values (String|Array)


8
9
10
# File 'lib/vedeu/models/style.rb', line 8

def initialize(values)
  @values = values
end

Instance Attribute Details

#valuesObject (readonly)

Returns the value of attribute values.



4
5
6
# File 'lib/vedeu/models/style.rb', line 4

def values
  @values
end

Instance Method Details

#escape_sequencesString (private)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (String)


21
22
23
24
25
26
27
28
29
# File 'lib/vedeu/models/style.rb', line 21

def escape_sequences
  @_sequences ||= if values.nil? || values.empty?
    ''

  else
    Array(values).flatten.map { |value| Esc.string(value) }.join

  end
end

#to_sString

Returns:

  • (String)


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

def to_s
  escape_sequences
end