module Mackarel::Core

Public Instance Methods

and_also()
Alias for: when_i
and_i()
Alias for: when_i
and_there_exist(number, what, *args, called: "
Alias for: create_a_list_of
and_there_exists_a(what, *args, called: what, **options)
Alias for: create_a
and_there_exists_an(what, *args, called: what, **options)
Alias for: create_a
create_a(what, *args, called: what, **options) { |asset| ... } click to toggle source
# File lib/mackarel/core.rb, line 7
def create_a(what, *args, called: what, **options)
  asset = factory.create(what, *args, **options)
  if called
    called = called.to_s.underscore.tr("/", "_")
    instance_variable_set("@#{called}", asset)
  end
  yield(asset) if block_given?
  asset
end
create_a_list_of(number, what, *args, called: " { |asset| ... } click to toggle source
# File lib/mackarel/core.rb, line 17
def create_a_list_of(number, what, *args, called: "#{what}_list", **options)
  asset = factory.create_list(what, number, *args, **options)
  if called
    called = called.underscore.tr("/", "_")
    instance_variable_set("@#{called}", asset)
  end
  yield(asset) if block_given?
  asset
end
Also aliased as: and_there_exist, when_there_exist
factory() click to toggle source
# File lib/mackarel/core.rb, line 27
def factory
  Mackarel.config.factory
end
given()
Alias for: when_i
then_i()
Alias for: when_i
when_i() { || ... } click to toggle source
# File lib/mackarel/core.rb, line 3
def when_i
  yield
end
Also aliased as: and_i, and_also, given, then_i
when_there_exist(number, what, *args, called: "
Alias for: create_a_list_of
when_there_exists_a(what, *args, called: what, **options)
Alias for: create_a
when_there_exists_an(what, *args, called: what, **options)
Alias for: create_a