Class: OpenXML::SpreadsheetML::SharedString
- Inherits:
-
Object
- Object
- OpenXML::SpreadsheetML::SharedString
- Defined in:
- lib/xlsx/shared_string.rb
Class Method Summary collapse
Instance Method Summary collapse
- #[](index) ⇒ Object
-
#initialize(values) ⇒ SharedString
constructor
values is an array.
Constructor Details
#initialize(values) ⇒ SharedString
values is an array
4 5 6 |
# File 'lib/xlsx/shared_string.rb', line 4 def initialize values # values is an array @values = values end |
Class Method Details
.parser(content) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/xlsx/shared_string.rb', line 12 def self.parser content values = [] doc = Nokogiri::XML content = doc.css('t') .each do |t| values << t.text end SharedString.new values end |
Instance Method Details
#[](index) ⇒ Object
8 9 10 |
# File 'lib/xlsx/shared_string.rb', line 8 def [] index @values[index] end |