class Mooncats::Metadata::Design
Public Class Methods
new( num )
click to toggle source
# File lib/mooncats/structs.rb, line 55 def initialize( num ) # 0-127 design num(ber) @num = num end
Public Instance Methods
bits()
click to toggle source
# File lib/mooncats/structs.rb, line 61 def bits ## keep private / internal - why? why not? ## keep 128 possible designs 0 to 127 ## as 7 bit string e.g. 01010111 for now - why? why not? @bits ||= '%08b' % @num end
face()
click to toggle source
# File lib/mooncats/structs.rb, line 70 def face ## face (expression) @face ||= FACES[ bits[2,2].to_i(2) ] end
Also aliased as: expression
facing()
click to toggle source
# File lib/mooncats/structs.rb, line 67 def facing @facing ||= FACINGS[ bits[1,1].to_i(2) ] ## use desgin > 63 instead - why? why not? end
fur()
click to toggle source
# File lib/mooncats/structs.rb, line 75 def fur ## fur (pattern) - add pattern alias - why? why not? @fur ||= FURS[ bits[4,2].to_i(2) ] end
pose()
click to toggle source
# File lib/mooncats/structs.rb, line 79 def pose @poses ||= POSES[ bits[6,2].to_i(2) ] ## use design % 4 instead - why? why not? end
to_i()
click to toggle source
# File lib/mooncats/structs.rb, line 59 def to_i() @num; end