Sha256: 6fd9f80fecc0730205da51c6fa1b234c369f722c1d605b6920d12307b47b55f0
Contents?: true
Size: 714 Bytes
Versions: 25
Compression:
Stored size: 714 Bytes
Contents
class Acfs::Resource # # Initialization drop-in for pre-4.0 ActiveModel. # module Initialization # # @api public # # Initializes a new model with the given `params`. fff # # @example # class User < Acfs::Resource # attribute :name # attribute :email, default: ->{ "#{name}@dom.tld" } # attribute :age, :integer, default: 18 # end # # user = User.new(name: 'bob') # user.name # => "bob" # user.email # => "bob@dom.tld" # user.age # => 18 # # @param params [Hash{Symbol => Object}] Attributes to set on resource. # def initialize(params = {}) write_attributes params if params end end end
Version data entries
25 entries across 25 versions & 1 rubygems