Method: JSONAPI::Field#initialize

Defined in:
lib/easy/jsonapi/field.rb

#initialize(name, type: String) ⇒ Field

Returns a new instance of Field.

Parameters:

  • name (String)

    The name of the field

  • type (String | nil) (defaults to: String)

    The type of the field



11
12
13
# File 'lib/easy/jsonapi/field.rb', line 11

def initialize(name, type: String)
  super({ name: name.to_s, type: type })
end