Class: Xcode::Project::Config::ObjectNode

Inherits:
Hash
  • Object
show all
Includes:
Decomment
Defined in:
lib/xcode/project/config/object_node.rb

Instance Method Summary collapse

Methods included from Decomment

#decomment

Constructor Details

#initialize(io) ⇒ ObjectNode

Returns a new instance of ObjectNode.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/xcode/project/config/object_node.rb', line 7

def initialize(io)
  ios = IOScanner.new(io)
  key = nil
  value = nil

  while token = ios.tokenize
    case token
    when ?}
      return
    when ?=
      key = decomment(ios.term)
      value = nil
    when ?{
      value = ObjectNode.new(io)
    when ?(
      value = ArrayNode.new(io)
    when ?;
      value = decomment(ios.term) if value.nil?
      self[key] = value
    end
  end
end

Instance Method Details

#isaObject



30
31
32
# File 'lib/xcode/project/config/object_node.rb', line 30

def isa
  self['isa']
end