Sha256: 1ee4325620b0877cd7986af1992fca42fa919b265435698ce5422432680b7ee8
Contents?: true
Size: 443 Bytes
Versions: 9
Compression:
Stored size: 443 Bytes
Contents
require "active_model" class Customer < Struct.new(:name, :id) extend ActiveModel::Naming include ActiveModel::Conversion undef_method :to_json def to_xml(options={}) if options[:builder] options[:builder].name name else "<name>#{name}</name>" end end def to_js(options={}) "name: #{name.inspect}" end alias :to_text :to_js def errors [] end def persisted? id.present? end end
Version data entries
9 entries across 9 versions & 1 rubygems