Class: ChoronSupport::Props::Base

Inherits:
Object
  • Object
show all
Includes:
Attributes
Defined in:
lib/choron_support/props/base.rb

Instance Method Summary collapse

Methods included from Attributes

#as_props

Constructor Details

#initialize(model, params = {}) ⇒ Base

Returns a new instance of Base.

Parameters:

  • model (ActiveRecord::Base)

    Props対象のモデルのインスタンス

  • params (Hash) (defaults to: {})

    その他のパラメータ

  • params (Boolean) (defaults to: {})

    params 指定した属性のみを出力します

  • params (Boolean) (defaults to: {})

    params 指定した属性を出力しません



12
13
14
15
# File 'lib/choron_support/props/base.rb', line 12

def initialize(model, params = {})
  @model = model
  @params = params.to_h
end