Class: Utopia::Tags::Environment

Inherits:
Object
  • Object
show all
Defined in:
lib/utopia/tags/environment.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(environment) ⇒ Environment

Returns a new instance of Environment.



28
29
30
# File 'lib/utopia/tags/environment.rb', line 28

def initialize(environment)
	@environment = environment
end

Class Method Details

.for(environment) ⇒ Object



24
25
26
# File 'lib/utopia/tags/environment.rb', line 24

def self.for(environment)
	self.new(environment)
end

Instance Method Details

#call(transaction, state) ⇒ Object



32
33
34
35
36
37
38
# File 'lib/utopia/tags/environment.rb', line 32

def call(transaction, state)
	only = state[:only].split(",").collect(&:to_sym) rescue []

	if defined?(@environment) and only.include?(@environment)
		transaction.parse_markup(state.content)
	end
end