Class: Cryptopunks::Metadata::Sprite

Inherits:
Object
  • Object
show all
Defined in:
lib/cryptopunks/generator.rb

Overview

todo/fix:

move into Punks::Metadata or such

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, name:, type:, gender:, size:, more_names: []) ⇒ Sprite

Returns a new instance of Sprite.



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/cryptopunks/generator.rb', line 11

def initialize( id:,
                name:,
                type:,
                gender:,
                size:,
                more_names: [] )
   @id         = id      # zero-based index eg. 0,1,2,3, etc.
   @name       = name
   @type       = type
   @gender     = gender
   @size       = size
   @more_names = more_names
end

Instance Attribute Details

#genderObject (readonly)

Returns the value of attribute gender.



8
9
10
# File 'lib/cryptopunks/generator.rb', line 8

def gender
  @gender
end

#idObject (readonly)

Returns the value of attribute id.



8
9
10
# File 'lib/cryptopunks/generator.rb', line 8

def id
  @id
end

#more_namesObject (readonly)

Returns the value of attribute more_names.



8
9
10
# File 'lib/cryptopunks/generator.rb', line 8

def more_names
  @more_names
end

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/cryptopunks/generator.rb', line 8

def name
  @name
end

#sizeObject (readonly)

Returns the value of attribute size.



8
9
10
# File 'lib/cryptopunks/generator.rb', line 8

def size
  @size
end

#typeObject (readonly)

Returns the value of attribute type.



8
9
10
# File 'lib/cryptopunks/generator.rb', line 8

def type
  @type
end

Instance Method Details

#archetype?Boolean

Returns:

  • (Boolean)


28
# File 'lib/cryptopunks/generator.rb', line 28

def archetype?()  @type.downcase.start_with?( 'archetype' ); end

#attribute?Boolean

todo/check - find better names for type attribute/archetypes?

use (alternate name/alias) base or face  for archetypes? any others?

Returns:

  • (Boolean)


27
# File 'lib/cryptopunks/generator.rb', line 27

def attribute?()  @type.downcase.start_with?( 'attribute' ); end

#female?Boolean

Returns:

  • (Boolean)


36
# File 'lib/cryptopunks/generator.rb', line 36

def female?()    @gender == 'f'; end

#large?Boolean

Returns:

  • (Boolean)


31
# File 'lib/cryptopunks/generator.rb', line 31

def large?()     @size == 'l'; end

#male?Boolean

Returns:

  • (Boolean)


35
# File 'lib/cryptopunks/generator.rb', line 35

def male?()      @gender == 'm'; end

#small?Boolean

Returns:

  • (Boolean)


30
# File 'lib/cryptopunks/generator.rb', line 30

def small?()     @size == 's'; end

#unisex?Boolean

Returns:

  • (Boolean)


37
# File 'lib/cryptopunks/generator.rb', line 37

def unisex?()    @gender == 'u'; end

#universal?Boolean Also known as: unisize?

Returns:

  • (Boolean)


32
# File 'lib/cryptopunks/generator.rb', line 32

def universal?() @size == 'u'; end