Changeset 229

Show
Ignore:
Timestamp:
06/12/05 08:31:47 (3 years ago)
Author:
ged
Message:
  • Added Debuggable and Loggable.
  • Fixed PairStruct?.
  • Fixed the inheritance callback -- module_eval in the subclass, not class << subclass.
  • Added an accessor for @value.
  • Fixed up tests.
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/lib/fm/properties/fuzzy.rb

    r224 r229  
    2727### Fuzzily-valued property class 
    2828class FaerieMUD::Property::Fuzzy < FaerieMUD::Property 
    29     include Comparable 
     29    include Comparable, FaerieMUD::Loggable, FaerieMUD::Debuggable 
    3030 
    3131    # SVN Revision 
     
    3636 
    3737    # Struct type for storing the low/high description paira 
    38     PairStruct = Struct::new( "FaerieMUD::Property::PairStruct", :low, :high ) 
     38    PairStruct = Struct::new( "FMPairStruct", :low, :high ) 
    3939 
    4040 
     
    5353    ### in subclasses. 
    5454    def self::inherited( subclass ) 
    55         class << subclass 
     55        FaerieMUD::Logger[self].debug "Adding descriptionPair ivar to %p" % [subclass] 
     56        subclass.module_eval { 
    5657            @descriptionPair = PairStruct::new() 
    57         end 
     58        } 
    5859    end 
    5960 
     
    9798    public 
    9899    ###### 
     100 
     101    # The raw value of the property 
     102    attr_reader :value 
     103 
    99104 
    100105    ### Comparison operation; returns +true+ when the given +otherProperty+ is