lib/odania/config/layout.rb in odania-0.0.32 vs lib/odania/config/layout.rb in odania-0.0.33
- old
+ new
@@ -1,40 +1,30 @@
module Odania
module Config
- class Layout
- attr_accessor :styles
+ class Layout < PageBase
+ attr_accessor :config
def initialize
reset
end
- def assets
- return {} if self.styles['_general'].nil? or self.styles['_general'].assets.nil?
- self.styles['_general'].assets
- end
-
def dump
- style_data = {}
- styles.each_pair do |name, style|
- style_data[name] = style.dump
- end
-
- result = {}
- result['styles'] =style_data unless style_data.nil?
+ result = super
+ result['config'] = config unless config.nil?
result
end
def load(data, group_name)
reset
- unless data['styles'].nil?
- data['styles'].each_pair do |key, val|
- self.styles[key].load(val, group_name)
- end
+ super(data, group_name)
+ unless data['config'].nil?
+ self.config = data['config']
end
end
def reset
- self.styles = Hash.new { |hash, key| hash[key] = Style.new(key) }
+ super
+ self.config = {}
end
end
end
end