Sha256: 2af4464eace761c91c95812487d054c87705379e669aa69ac0089474cd91e80d
Contents?: true
Size: 760 Bytes
Versions: 17
Compression:
Stored size: 760 Bytes
Contents
module Bulldog class Style def initialize(name, attributes={}) @name = name @attributes = attributes end attr_reader :name, :attributes # # Return the value of the given style attribute. # delegate :[], :to => :attributes # # Set the value of the given style attribute. # delegate :[]=, :to => :attributes # # Return true if the argument is a Style with the same name and # attributes. # def ==(other) other.is_a?(self.class) && name == other.name && attributes == other.attributes end def inspect "#<Style #{name.inspect} #{attributes.inspect}>" end delegate :hash, :eql?, :to => :name ORIGINAL = new(:original, {}) end end
Version data entries
17 entries across 17 versions & 1 rubygems