Class: Ovaltine::Storyboard
- Inherits:
-
Object
- Object
- Ovaltine::Storyboard
- Defined in:
- lib/ovaltine/storyboard.rb
Instance Attribute Summary collapse
-
#cell_reuse_identifiers ⇒ Object
readonly
Returns the value of attribute cell_reuse_identifiers.
-
#filepaths ⇒ Object
readonly
Returns the value of attribute filepaths.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#segue_identifiers ⇒ Object
readonly
Returns the value of attribute segue_identifiers.
-
#view_controller_identifiers ⇒ Object
readonly
Returns the value of attribute view_controller_identifiers.
Instance Method Summary collapse
-
#initialize(name, filepaths) ⇒ Storyboard
constructor
A new instance of Storyboard.
- #parse(path) ⇒ Object
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.(f))} end |
Instance Attribute Details
#cell_reuse_identifiers ⇒ Object (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 |
#filepaths ⇒ Object (readonly)
Returns the value of attribute filepaths.
4 5 6 |
# File 'lib/ovaltine/storyboard.rb', line 4 def filepaths @filepaths end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/ovaltine/storyboard.rb', line 4 def name @name end |
#segue_identifiers ⇒ Object (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_identifiers ⇒ Object (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 |