Module: Pixelator
- Defined in:
- lib/pixelator.rb,
lib/pixelator/engine.rb,
lib/pixelator/version.rb
Defined Under Namespace
Classes: Engine
Constant Summary collapse
- VERSION =
"0.0.1"
Class Attribute Summary collapse
-
.config_file ⇒ Object
Returns the value of attribute config_file.
-
.data ⇒ Object
Returns the value of attribute data.
-
.run_envs ⇒ Object
Returns the value of attribute run_envs.
Class Method Summary collapse
Class Attribute Details
.config_file ⇒ Object
Returns the value of attribute config_file.
10 11 12 |
# File 'lib/pixelator.rb', line 10 def config_file @config_file end |
.data ⇒ Object
Returns the value of attribute data.
9 10 11 |
# File 'lib/pixelator.rb', line 9 def data @data end |
.run_envs ⇒ Object
Returns the value of attribute run_envs.
11 12 13 |
# File 'lib/pixelator.rb', line 11 def run_envs @run_envs end |
Class Method Details
.configure {|_self| ... } ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/pixelator.rb', line 14 def self.configure self.run_envs = ['production'] yield(self) if block_given? self.data = HashWithIndifferentAccess.new self.data[:pixels] = YAML.load_file(config_file).with_indifferent_access self.data[:pixels].each do |k,v| if v.is_a?(Array) v.map! do |a| a['snippet'] = URI.escape(a['snippet']) a end end end self.data[:context] = HashWithIndifferentAccess.new end |
.context ⇒ Object
34 35 36 |
# File 'lib/pixelator.rb', line 34 def self.context data[:context] end |
.pixels ⇒ Object
30 31 32 |
# File 'lib/pixelator.rb', line 30 def self.pixels data[:pixels] end |