class AxlsxEnhanced::Helpers::Styles::StyleCollection

Public Class Methods

new(worksheet, items = []) click to toggle source
# File lib/axlsx_enhanced/helpers/styles/style_collection.rb, line 5
def initialize(worksheet, items = [])
  @worksheet = worksheet
  @collection = []
      
  self.add(items)
end

Public Instance Methods

add(args) click to toggle source
# File lib/axlsx_enhanced/helpers/styles/style_collection.rb, line 20
def add(args)
  items = args.is_a?(Array) ? args : [args]
      
  items.each do |item|
    self.collection.push AxlsxEnhanced::Helpers::Styles::Style.new(item)
  end
end
collection() click to toggle source
# File lib/axlsx_enhanced/helpers/styles/style_collection.rb, line 16
def collection
  return @collection
end
find(name) click to toggle source
# File lib/axlsx_enhanced/helpers/styles/style_collection.rb, line 28
def find(name)
  return @collection.find { |x| x.name == name.to_sym }
end
worksheet() click to toggle source
# File lib/axlsx_enhanced/helpers/styles/style_collection.rb, line 12
def worksheet
  return @worksheet
end