Class: Sassy::SCSS::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/sassy/scss/builder.rb

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ Builder

Returns a new instance of Builder.



5
6
7
# File 'lib/sassy/scss/builder.rb', line 5

def initialize(&block)
  instance_eval(&block)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object (private)



21
22
23
24
25
26
27
# File 'lib/sassy/scss/builder.rb', line 21

def method_missing(method, *args, &block)
  if block_given?
    rule_set.add(Rule.new(method, &block))
  else
    super
  end
end

Instance Method Details

#r(selector, &block) ⇒ Object



11
12
13
# File 'lib/sassy/scss/builder.rb', line 11

def r(selector, &block)
  rule_set.add(selector, &block)
end