Class: Ovaltine::Storyboard

Inherits:
Object
  • Object
show all
Defined in:
lib/ovaltine/storyboard.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, filepaths) ⇒ Storyboard

Returns a new instance of Storyboard.



7
8
9
10
11
12
13
# File 'lib/ovaltine/storyboard.rb', line 7

def initialize name, filepaths
  @name, @filepaths = name, filepaths
  @cell_reuse_identifiers = []
  @segue_identifiers = []
  @view_controller_identifiers = []
  filepaths.each {|f| parse(File.expand_path(f))}
end

Instance Attribute Details

#cell_reuse_identifiersObject (readonly)

Returns the value of attribute cell_reuse_identifiers.



4
5
6
# File 'lib/ovaltine/storyboard.rb', line 4

def cell_reuse_identifiers
  @cell_reuse_identifiers
end

#filepathsObject (readonly)

Returns the value of attribute filepaths.



4
5
6
# File 'lib/ovaltine/storyboard.rb', line 4

def filepaths
  @filepaths
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/ovaltine/storyboard.rb', line 4

def name
  @name
end

#segue_identifiersObject (readonly)

Returns the value of attribute segue_identifiers.



4
5
6
# File 'lib/ovaltine/storyboard.rb', line 4

def segue_identifiers
  @segue_identifiers
end

#view_controller_identifiersObject (readonly)

Returns the value of attribute view_controller_identifiers.



4
5
6
# File 'lib/ovaltine/storyboard.rb', line 4

def view_controller_identifiers
  @view_controller_identifiers
end

Instance Method Details

#parse(path) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/ovaltine/storyboard.rb', line 15

def parse path
  load_dependencies
  document = REXML::Document.new(File.new(path))
  document.get_elements('//').each do |node|
    parse_identifiers(node)
  end
end