Class: Styles::Stylesheet::EvalContext

Inherits:
Object
  • Object
show all
Defined in:
lib/styles/stylesheet.rb

Overview

Instances serve as throwaway execution contexts for user-produced stylesheet text. This is useful so that methods that only serve to support the DSL do not pollute the resulting Stylesheet object. Also, method definitions or overrides in the stylesheet will not affect the Stylesheet (probably). Since we are executing Ruby code there is no guarantee that that something won’t get messed up, but this makes inadvertently doing so much less likely.

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name) ⇒ Object

Supports the DSL for stylesheets, making them more attractive and CSS-y by allowing property values to be specified like this

color: red

instead of like this

color: :red


97
98
99
# File 'lib/styles/stylesheet.rb', line 97

def method_missing(name)
  name
end