Class: Cryptopunks::Metadata::Sprite
- Inherits:
-
Object
- Object
- Cryptopunks::Metadata::Sprite
- Defined in:
- lib/cryptopunks/generator.rb
Overview
todo/fix:
move into Punks::Metadata or such
Instance Attribute Summary collapse
-
#gender ⇒ Object
readonly
Returns the value of attribute gender.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #archetype? ⇒ Boolean
-
#attribute? ⇒ Boolean
todo/check - find better names for type attribute/archetypes? use (alternate name/alias) base or face for archetypes? any others?.
-
#initialize(id:, name:, type:, gender:) ⇒ Sprite
constructor
A new instance of Sprite.
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
#gender ⇒ Object (readonly)
Returns the value of attribute gender.
8 9 10 |
# File 'lib/cryptopunks/generator.rb', line 8 def gender @gender end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'lib/cryptopunks/generator.rb', line 8 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/cryptopunks/generator.rb', line 8 def name @name end |
#type ⇒ Object (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
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?
23 |
# File 'lib/cryptopunks/generator.rb', line 23 def attribute?() @type.downcase.start_with?( 'attribute' ); end |