Sha256: b89d73112319e0be30e5547e131150e86cbd726944f4f9bb726b688b12792088

Contents?: true

Size: 1.13 KB

Versions: 3

Compression:

Stored size: 1.13 KB

Contents

require 'medieval/attributes'

module Medieval
  class Battalion
    extend Attributes
    class << self
      def name
        FORMATS.rand.call.join(' ')
      end


protected

      def creature_name
        super.pluralize
      end



    end

    FORMATS = [
      Proc.new { ["The", name_of_order, formation_name, "of", ability, colour, creature_name]},
      Proc.new { ["The", name_of_order, formation_name, "of", ability, colour, creature_name]},
      Proc.new { ["The", name_of_order, formation_name, "of", ability, creature_name]},
      Proc.new { ["The", name_of_order, formation_name, "of", colour, creature_name]},
      Proc.new { ["The", name_of_order, formation_name, "of", colour, occupation.pluralize ]},
      Proc.new { ["The", name_of_order, formation_name, "of", ability, occupation.pluralize]},
      Proc.new { ["The", name_of_order, formation_name, "of", ability, colour, occupation.pluralize]},
      #Proc.new { ["The", ability, colour, creature_name]},
      #Proc.new { ["The", colour, creature_name]},
      #Proc.new { ["The", ability , creature_name]}
      # removed some less interesting formats
    ]

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
medieval-0.5.2 lib/medieval/battalion.rb
medieval-0.5.1 lib/medieval/battalion.rb
medieval-0.5.0 lib/medieval/battalion.rb