Sha256: 7f6e1f8b34f4ee94dc545400a874d87c01941737c28cf35c4f8bd24f92bd243f

Contents?: true

Size: 638 Bytes

Versions: 3

Compression:

Stored size: 638 Bytes

Contents

require 'chozo/varia_model'

module Chozo
  module Config
    # @author Jamie Winsor <jamie@vialstudios.com>
    # @api private
    class Abstract
      extend Forwardable
      include VariaModel
      
      attr_accessor :path

      def_delegator :to_hash, :slice
      def_delegator :to_hash, :slice!
      def_delegator :to_hash, :extract!

      # @param [String] path
      # @param [Hash] attributes
      def initialize(path = nil, attributes = {})
        @path = File.expand_path(path) if path

        mass_assign(attributes)
      end

      def to_hash
        super.to_hash.deep_symbolize_keys
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
chozo-0.6.1 lib/chozo/config/abstract.rb
chozo-0.6.0 lib/chozo/config/abstract.rb
chozo-0.5.0 lib/chozo/config/abstract.rb