Class: Cryptopunks::Metadata

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

Defined Under Namespace

Classes: Accessory, AccessoryType, Type

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#accessoriesObject (readonly)

Returns the value of attribute accessories.



128
129
130
# File 'lib/cryptopunks/structs.rb', line 128

def accessories
  @accessories
end

#birthdayObject (readonly)

Returns the value of attribute birthday.



128
129
130
# File 'lib/cryptopunks/structs.rb', line 128

def birthday
  @birthday
end

#idObject (readonly)

Returns the value of attribute id.



128
129
130
# File 'lib/cryptopunks/structs.rb', line 128

def id
  @id
end

#typeObject (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)

Returns:

  • (Boolean)


141
# File 'lib/cryptopunks/structs.rb', line 141

def alien?()  @type.name=='Alien'; end

#ape?Boolean

Returns:

  • (Boolean)


142
# File 'lib/cryptopunks/structs.rb', line 142

def ape?()    @type.name=='Ape'; end

#female?Boolean

Returns:

  • (Boolean)


144
# File 'lib/cryptopunks/structs.rb', line 144

def female?() @type.name=='Female'; end

#male?Boolean

Returns:

  • (Boolean)


145
# File 'lib/cryptopunks/structs.rb', line 145

def male?()   @type.name=='Male'; end

#zombie?Boolean

Returns:

  • (Boolean)


143
# File 'lib/cryptopunks/structs.rb', line 143

def zombie?() @type.name=='Zombie'; end