Class: Cryptopunks::Metadata
- Inherits:
-
Object
- Object
- Cryptopunks::Metadata
- Defined in:
- lib/cryptopunks/structs.rb
Defined Under Namespace
Classes: Accessory, AccessoryType, Type
Instance Attribute Summary collapse
-
#accessories ⇒ Object
readonly
Returns the value of attribute accessories.
-
#birthday ⇒ Object
readonly
Returns the value of attribute birthday.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#alien? ⇒ Boolean
convenience helpers for types (5).
- #ape? ⇒ Boolean
- #female? ⇒ Boolean
-
#initialize(id, type, accessories) ⇒ Metadata
constructor
A new instance of Metadata.
- #male? ⇒ Boolean
- #zombie? ⇒ Boolean
Constructor Details
#initialize(id, type, accessories) ⇒ Metadata
Returns a new instance of Metadata.
133 134 135 136 137 138 |
# File 'lib/cryptopunks/structs.rb', line 133 def initialize( id, type, accessories ) @id = id @type = type @accessories = accessories @birthday = Date.new( 2017, 6, 23) ## all 10,000 minted on June 23, 2017 end |
Instance Attribute Details
#accessories ⇒ Object (readonly)
Returns the value of attribute accessories.
128 129 130 |
# File 'lib/cryptopunks/structs.rb', line 128 def accessories @accessories end |
#birthday ⇒ Object (readonly)
Returns the value of attribute birthday.
128 129 130 |
# File 'lib/cryptopunks/structs.rb', line 128 def birthday @birthday end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
128 129 130 |
# File 'lib/cryptopunks/structs.rb', line 128 def id @id end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
128 129 130 |
# File 'lib/cryptopunks/structs.rb', line 128 def type @type end |
Instance Method Details
#alien? ⇒ Boolean
convenience helpers for types (5)
141 |
# File 'lib/cryptopunks/structs.rb', line 141 def alien?() @type.name=='Alien'; end |
#ape? ⇒ Boolean
142 |
# File 'lib/cryptopunks/structs.rb', line 142 def ape?() @type.name=='Ape'; end |
#female? ⇒ Boolean
144 |
# File 'lib/cryptopunks/structs.rb', line 144 def female?() @type.name=='Female'; end |
#male? ⇒ Boolean
145 |
# File 'lib/cryptopunks/structs.rb', line 145 def male?() @type.name=='Male'; end |
#zombie? ⇒ Boolean
143 |
# File 'lib/cryptopunks/structs.rb', line 143 def zombie?() @type.name=='Zombie'; end |