You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: styles_extractor.rb
    path of file: ./repos/lookbook/lib/lookbook/services/templates
    
    the code of the file until where you have to start completion: require "css_parser"

module Lookbook
  class StylesExtractor < Service
    STYLE_TAGS_REGEX = /<style(?:\s[^>]*)?>((?:(?!<\/style>).)*)<\/style>/m

    attr_reader :content

    def initialize(
    
    def extract_styles(text)
      css_parser = ::CssParser::Parser.new
      text.scan(STYLE_TAGS_REGEX).flatten.map(&:strip).each do |css|
        css_parser.load_string!(css.strip)
      end

      styles = []
      css_parser.each_selector do |selector, declarations, specificity|
        styles << "#{selector} { #{declarations} }"
      end
      styles
    end