Sha256: 3b4583cb74907ee74900a90767a660040c77de9a3d441f72fc9e00b7339b74e1

Contents?: true

Size: 449 Bytes

Versions: 18

Compression:

Stored size: 449 Bytes

Contents

# -*- encoding : utf-8 -*-
module Dao
  class Data < ::Map
  # look good for inspect
  #
    def inspect
      Dao.json_for(self)
    end

  # support updates with dao-ish objects
  #
    add_conversion_method!(:to_dao)
    add_conversion_method!(:as_dao)

    def update(*args, &block)
      if args.size==1 and args.first.respond_to?(:to_dao)
        to_dao = args.first.to_dao
        return super(to_dao)
      end
      super
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
dao-8.0.1 lib/dao/data.rb
dao-8.0.0 lib/dao/data.rb
dao-7.0.0 lib/dao/data.rb
dao-5.6.1 lib/dao/data.rb
dao-5.5.2 lib/dao/data.rb
dao-5.5.1 lib/dao/data.rb
dao-5.5.0 lib/dao/data.rb
dao-5.4.0 lib/dao/data.rb
dao-5.3.3 lib/dao/data.rb
dao-5.3.2 lib/dao/data.rb
dao-5.3.0 lib/dao/data.rb
dao-5.2.1 lib/dao/data.rb
dao-5.1.2 lib/dao/data.rb
dao-5.1.1 lib/dao/data.rb
dao-5.0.0 lib/dao/data.rb
dao-4.6.4 lib/dao/data.rb
dao-4.4.4 lib/dao/data.rb
dao-4.4.2 lib/dao/data.rb