Sha256: 81b4105954b2aa2ab8af1934f7829d16a911f9e7830dd91e868c0a13ec52d5e2

Contents?: true

Size: 655 Bytes

Versions: 1

Compression:

Stored size: 655 Bytes

Contents

module RailsAssist::Artifact
  RailsAssist.artifacts.each do |name|
    plural_name = name.to_s.pluralize
    class_eval %{
      module #{name.to_s.camelize}
        def replace_in_#{name} name, options={}, &block
          replace_in_artifact(name, set(options, :#{name}), &block)
        end

        def replace_in_#{plural_name} *names, &block
          replace_in_artifacts *names, &block
        end

        def insert_into_#{name}(name, options={}, &block)
          begin
            insert_into_artifact(name, set(options, :#{name}), &block)
            true
          rescue
            nil
          end
        end
      end
    }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails_artifactor-0.5.1 lib/rails_artifactor/artifact/crud/update.rb