Sha256: 34284f12f5f45e1f2888efa4de0fdc8451c9e1e71baa750556b2c3c54d68afef

Contents?: true

Size: 463 Bytes

Versions: 1

Compression:

Stored size: 463 Bytes

Contents

module SonJay
  module ActsAsModel

    def self.included(other)
      other.extend ClassBehavior
    end

    module ClassBehavior

      def json_create(json)
        data = JSON.parse( json )
        instance = new
        instance.sonj_content.load_data data
        instance
      end

      def array_class
        @array_class ||= begin
          klass = SonJay::ModelArray(self)
          const_set :Array, klass
        end
      end

    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
son_jay-0.1.1.alpha lib/son_jay/acts_as_model.rb