Class: Ulysses::Group
- Inherits:
-
Object
- Object
- Ulysses::Group
- Defined in:
- lib/ulysses/group.rb
Instance Attribute Summary collapse
-
#dirname ⇒ Object
readonly
Returns the value of attribute dirname.
Instance Method Summary collapse
- #children ⇒ Object
- #display_name ⇒ Object
-
#initialize(info_file_path) ⇒ Group
constructor
A new instance of Group.
- #sheets ⇒ Object
Constructor Details
#initialize(info_file_path) ⇒ Group
Returns a new instance of Group.
6 7 8 9 |
# File 'lib/ulysses/group.rb', line 6 def initialize(info_file_path) @dirname = File.dirname(info_file_path) @info = parse_info(info_file_path) end |
Instance Attribute Details
#dirname ⇒ Object (readonly)
Returns the value of attribute dirname.
4 5 6 |
# File 'lib/ulysses/group.rb', line 4 def dirname @dirname end |
Instance Method Details
#children ⇒ Object
15 16 17 18 19 |
# File 'lib/ulysses/group.rb', line 15 def children @info['childOrder'].children.map do |child| Group.new File.join(@dirname, child.content, 'Info.ulgroup') if child.element? end.compact end |
#display_name ⇒ Object
11 12 13 |
# File 'lib/ulysses/group.rb', line 11 def display_name @display_name = @info['displayName'].content end |
#sheets ⇒ Object
21 22 23 24 25 26 |
# File 'lib/ulysses/group.rb', line 21 def sheets list = @info['sheetClusters'].children.find { |child| child.element? && child.name == 'array' } list.children.map do |child| Sheet.new File.join(@dirname, child.content) if child.element? && child.name == 'string' end.compact end |