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.
-
#more_names ⇒ Object
readonly
Returns the value of attribute more_names.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
-
#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?.
- #female? ⇒ Boolean
-
#initialize(id:, name:, type:, gender:, size:, more_names: []) ⇒ Sprite
constructor
A new instance of Sprite.
- #large? ⇒ Boolean
- #male? ⇒ Boolean
- #small? ⇒ Boolean
- #unisex? ⇒ Boolean
- #universal? ⇒ Boolean (also: #unisize?)
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
#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 |
#more_names ⇒ Object (readonly)
Returns the value of attribute more_names.
8 9 10 |
# File 'lib/cryptopunks/generator.rb', line 8 def more_names @more_names end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/cryptopunks/generator.rb', line 8 def name @name end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
8 9 10 |
# File 'lib/cryptopunks/generator.rb', line 8 def size @size 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
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?
27 |
# File 'lib/cryptopunks/generator.rb', line 27 def attribute?() @type.downcase.start_with?( 'attribute' ); end |
#female? ⇒ Boolean
36 |
# File 'lib/cryptopunks/generator.rb', line 36 def female?() @gender == 'f'; end |
#large? ⇒ Boolean
31 |
# File 'lib/cryptopunks/generator.rb', line 31 def large?() @size == 'l'; end |
#male? ⇒ Boolean
35 |
# File 'lib/cryptopunks/generator.rb', line 35 def male?() @gender == 'm'; end |
#small? ⇒ Boolean
30 |
# File 'lib/cryptopunks/generator.rb', line 30 def small?() @size == 's'; end |
#unisex? ⇒ Boolean
37 |
# File 'lib/cryptopunks/generator.rb', line 37 def unisex?() @gender == 'u'; end |
#universal? ⇒ Boolean Also known as: unisize?
32 |
# File 'lib/cryptopunks/generator.rb', line 32 def universal?() @size == 'u'; end |