class Cryptopunks::Metadata::Type
nested class
Attributes
limit[R]
name[R]
Public Class Methods
all()
click to toggle source
# File lib/cryptopunks/structs.rb, line 40 def self.all() registry.values; end
build()
click to toggle source
# File lib/cryptopunks/structs.rb, line 26 def self.build TYPES.reduce( {} ) do |h, rec| type = Type.new( rec[:name], rec[:limit ] ) h[ rec[:name].downcase ] = type h end end
find( q )
click to toggle source
# File lib/cryptopunks/structs.rb, line 42 def self.find( q ) registry[ q.to_s.downcase ]; end
new( name, limit )
click to toggle source
# File lib/cryptopunks/structs.rb, line 14 def initialize( name, limit ) @name = name @limit = limit end
registry()
click to toggle source
# File lib/cryptopunks/structs.rb, line 34 def self.registry ## auto-build registry (hash table) lookup (by name) @@types ||= build @@types end
Public Instance Methods
inspect()
click to toggle source
def to_s() @name; end
# File lib/cryptopunks/structs.rb, line 20 def inspect %Q{<Type "#{@name}", limit: #{@limit}>} end