class Bytemapper::Shape
Attributes
hooks[RW]
Public Class Methods
new()
click to toggle source
Calls superclass method
# File lib/bytemapper/shape.rb, line 25 def initialize super @hooks = [] end
Public Instance Methods
[]=(k,v)
click to toggle source
Calls superclass method
# File lib/bytemapper/shape.rb, line 30 def []=(k,v) super singleton_class.instance_eval { attr_reader k } instance_variable_set("@#{k.to_s}", self[k]) end
hook(&block)
click to toggle source
# File lib/bytemapper/shape.rb, line 36 def hook(&block) @hooks << block if block_given? end
size()
click to toggle source
# File lib/bytemapper/shape.rb, line 40 def size flatten.values.map(&:size).reduce(:+) end