class Dieses::Application::Mixins::Scribes

Public Class Methods

[](type) click to toggle source
# File lib/dieses/application/mixins/scribes.rb, line 7
def self.[](type)
  raise ArgumentError, "No such Scribes type available: #{type}" unless Bundle.method_defined? type

  new(type)
end
new(type) click to toggle source
Calls superclass method
# File lib/dieses/application/mixins/scribes.rb, line 13
def initialize(type)
  super()
  @type = type.to_sym
end

Public Instance Methods

included(base) click to toggle source
# File lib/dieses/application/mixins/scribes.rb, line 64
def included(base)
  base.include Lines

  base.extend ClassMethods
  base.include InstanceMethods

  base.extend Bundle

  base.variate_scribes(unit: @unit, ratio: @ratio, gap: @gap) if @unit

  base.send(@type)
end
with(unit:, ratio: [1/1r], gap: [0]) click to toggle source
# File lib/dieses/application/mixins/scribes.rb, line 18
def with(unit:, ratio: [1/1r], gap: [0])
  tap do
    @unit  = unit
    @ratio = ratio
    @gap   = gap
  end
end