Class: JSONAPIonify::Types::ObjectType

Inherits:
BaseType
  • Object
show all
Defined in:
lib/jsonapionify/types/object_type.rb

Instance Attribute Summary

Attributes inherited from BaseType

#options

Instance Method Summary collapse

Methods inherited from BaseType

dumper, #initialize, loader, #name, #not_null!, #not_null?, #to_s

Methods included from Callbacks

#run_callbacks

Constructor Details

This class inherits a constructor from JSONAPIonify::Types::BaseType

Instance Method Details

#sample(field_name) ⇒ Object



19
20
21
22
23
24
# File 'lib/jsonapionify/types/object_type.rb', line 19

def sample(field_name)
  field_name = field_name.to_s.singularize.to_sym
  %i{foo bar baz}.each_with_object({}) do |k, h|
    h[k] = StringType.new.sample(field_name)
  end
end