Class: Cryptopunks::Metadata::Sprite

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

Overview

todo/fix:

move into Punks:: or such

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, name:, type:, gender:) ⇒ Sprite

Returns a new instance of Sprite.



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

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

   @name   = name
   @type   = type
   @gender = gender
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

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
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)


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

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)


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

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