Class: Parse::Conf::GitosisStyle

Inherits:
Object
  • Object
show all
Defined in:
lib/parse/conf/gitosis_style.rb

Constant Summary collapse

Helper =
Parse::Conf::ParserHelper

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config_raw, separator = " ") ⇒ GitosisStyle

Returns a new instance of GitosisStyle.



8
9
10
11
12
13
14
15
# File 'lib/parse/conf/gitosis_style.rb', line 8

def initialize(config_raw, separator = " ")
  @config_raw = config_raw
  @data = {}

  @empty_group_name = 'without_group'
  @separator = separator
  @data[empty_group_name] = []
end

Instance Attribute Details

#config_rawObject (readonly)

Returns the value of attribute config_raw.



4
5
6
# File 'lib/parse/conf/gitosis_style.rb', line 4

def config_raw
  @config_raw
end

#dataObject (readonly)

Returns the value of attribute data.



4
5
6
# File 'lib/parse/conf/gitosis_style.rb', line 4

def data
  @data
end

#empty_group_nameObject (readonly)

Returns the value of attribute empty_group_name.



4
5
6
# File 'lib/parse/conf/gitosis_style.rb', line 4

def empty_group_name
  @empty_group_name
end

Class Method Details

.run(config_raw, separator = " ") ⇒ Object



22
23
24
25
# File 'lib/parse/conf/gitosis_style.rb', line 22

def self.run(config_raw, separator = " ")
  obj = new(config_raw, separator)
  obj.result
end

Instance Method Details

#resultObject



17
18
19
20
# File 'lib/parse/conf/gitosis_style.rb', line 17

def result
  parse unless @parsed
  @data
end