Sha256: 2a13ef43e58ca6ffe6de733bc6817956605b83033385f89cee98a28633942c67

Contents?: true

Size: 656 Bytes

Versions: 1

Compression:

Stored size: 656 Bytes

Contents

require 'glimmer/dsl/static_expression'
require 'glimmer/css/style_sheet'
require 'glimmer/css/rule_set'

module Glimmer
  module DSL
    module CSS
      class SExpression < StaticExpression
        include ParentExpression

        def can_interpret?(parent, keyword, *args, &block)
          keyword == 's' and
            parent.is_a?(Glimmer::CSS::StyleSheet) and
            block_given? and
            !args.empty?
        end

        def interpret(parent, keyword, *args, &block)
          Glimmer::CSS::RuleSet.new(args.first.to_s).tap do |rule_set|
            parent.rule_sets << rule_set
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
glimmer-0.6.0 lib/glimmer/dsl/css/s_expression.rb