Sha256: d4e278aa33e2697c588f8f06282ac2764782b1f239219cf9f4aa97aeb05e98f6

Contents?: true

Size: 737 Bytes

Versions: 38

Compression:

Stored size: 737 Bytes

Contents

module Cure
  Rubicure::Girl.names.each do |girl_name|
    define_singleton_method girl_name do
      Rubicure::Girl.find(girl_name)
    end
  end

  def self.define_turnover_methods(target, original_human_name, another_human_name)
    target.instance_variable_set(:@__original_human_name, original_human_name)
    target.instance_variable_set(:@__another_human_name,  another_human_name)

    def target.!
      humanize!
      @another_human_name ||= @__another_human_name

      self[:human_name], @another_human_name = @another_human_name, self[:human_name]

      self
    end

    def target.rollback
      self[:human_name]   = @__original_human_name
      @another_human_name = @__another_human_name
      self
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
rubicure-3.3.3 lib/rubicure/cure.rb
rubicure-3.3.2 lib/rubicure/cure.rb
rubicure-3.3.1 lib/rubicure/cure.rb
rubicure-3.3.0 lib/rubicure/cure.rb
rubicure-3.3.0.rc2 lib/rubicure/cure.rb
rubicure-3.3.0.rc1 lib/rubicure/cure.rb
rubicure-3.2.6 lib/rubicure/cure.rb
rubicure-3.2.5 lib/rubicure/cure.rb
rubicure-3.2.4 lib/rubicure/cure.rb
rubicure-3.2.3 lib/rubicure/cure.rb
rubicure-3.2.2 lib/rubicure/cure.rb
rubicure-3.2.1 lib/rubicure/cure.rb
rubicure-3.2.0 lib/rubicure/cure.rb
rubicure-3.2.0.rc1 lib/rubicure/cure.rb
rubicure-3.1.5 lib/rubicure/cure.rb
rubicure-3.1.4 lib/rubicure/cure.rb
rubicure-3.1.3 lib/rubicure/cure.rb
rubicure-3.1.2 lib/rubicure/cure.rb
rubicure-3.1.1 lib/rubicure/cure.rb
rubicure-3.1.0 lib/rubicure/cure.rb