Class: Antwort::Style

Inherits:
Object
  • Object
show all
Defined in:
lib/antwort/builder/style.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(style = '') ⇒ Style

Returns a new instance of Style.



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/antwort/builder/style.rb', line 5

def initialize(style = '')
  @style          = style
  @keys           = []
  @duplicate_keys = []
  @flattened      = []
  @original       = []

  convert_to_hash

  self
end

Instance Attribute Details

#duplicate_keysObject (readonly)

Returns the value of attribute duplicate_keys.



3
4
5
# File 'lib/antwort/builder/style.rb', line 3

def duplicate_keys
  @duplicate_keys
end

#flattenedObject (readonly)

Returns the value of attribute flattened.



3
4
5
# File 'lib/antwort/builder/style.rb', line 3

def flattened
  @flattened
end

#keysObject (readonly)

Returns the value of attribute keys.



3
4
5
# File 'lib/antwort/builder/style.rb', line 3

def keys
  @keys
end

#originalObject (readonly)

Returns the value of attribute original.



3
4
5
# File 'lib/antwort/builder/style.rb', line 3

def original
  @original
end

Instance Method Details

#duplicates?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/antwort/builder/style.rb', line 25

def duplicates?
  !@duplicate_keys.empty?
end

#flattened_strObject



21
22
23
# File 'lib/antwort/builder/style.rb', line 21

def flattened_str
  hash_to_str @flattened
end

#original_strObject



17
18
19
# File 'lib/antwort/builder/style.rb', line 17

def original_str
  @style
end