Class: GitContext::ConfigData

Inherits:
Object
  • Object
show all
Defined in:
lib/git_context/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(home) ⇒ ConfigData

Returns a new instance of ConfigData.



9
10
11
12
13
# File 'lib/git_context/configuration.rb', line 9

def initialize(home)
  @home = home
  @profiles = []
  @contexts = []
end

Instance Attribute Details

#contextsObject (readonly)

Returns the value of attribute contexts.



7
8
9
# File 'lib/git_context/configuration.rb', line 7

def contexts
  @contexts
end

#homeObject (readonly)

Returns the value of attribute home.



7
8
9
# File 'lib/git_context/configuration.rb', line 7

def home
  @home
end

#profilesObject (readonly)

Returns the value of attribute profiles.



7
8
9
# File 'lib/git_context/configuration.rb', line 7

def profiles
  @profiles
end

Instance Method Details

#serializeObject



15
16
17
18
19
20
# File 'lib/git_context/configuration.rb', line 15

def serialize
  {
    'profiles' => profiles.map(&:serialize),
    'contexts' => contexts.map(&:serialize)
  }
end