Sha256: 8b0c317d5f8169c80c6044a09f7f15e7ce4065dcbd515a85d80ebc7818fbd2dd

Contents?: true

Size: 540 Bytes

Versions: 12

Compression:

Stored size: 540 Bytes

Contents

require 'machinist'
require 'machinist/blueprints'

module Machinist
  
  module ObjectExtensions
    def self.included(base)
      base.extend(ClassMethods)
    end
  
    module ClassMethods
      def make(*args, &block)
        lathe = Lathe.run(Machinist::ObjectAdapter, self.new, *args)
        lathe.object(&block)
      end
    end
  end
  
  class ObjectAdapter
    def self.has_association?(object, attribute)
      false
    end
  end
  
end

class Object
  include Machinist::Blueprints
  include Machinist::ObjectExtensions
end

Version data entries

12 entries across 12 versions & 7 rubygems

Version Path
jdhollis-machinist-1.0.0 lib/machinist/object.rb
jeremydurham-machinist-1.0.4 lib/machinist/object.rb
lawrencepit-machinist-1.0.2 lib/machinist/object.rb
lawrencepit-machinist-1.0.3 lib/machinist/object.rb
notahat-machinist-1.0.0 lib/machinist/object.rb
notahat-machinist-1.0.3 lib/machinist/object.rb
pk-machinist-1.0.3 lib/machinist/object.rb
JamieFlournoy-machinist-1.0.6 lib/machinist/object.rb
machinist-1.0.6 lib/machinist/object.rb
machinist-1.0.5 lib/machinist/object.rb
machinist-1.0.4 lib/machinist/object.rb
machinist-1.0.3 lib/machinist/object.rb