Method: JsonWorld::DSL::ClassMethods#property

Defined in:
lib/json_world/dsl.rb

#property(property_name, options = {}) ⇒ Object

Parameters:

  • property_name (Symbol)
  • options (Hash{Symbol => Object}) (defaults to: {})


69
70
71
72
73
74
75
76
# File 'lib/json_world/dsl.rb', line 69

def property(property_name, options = {})
  property_definitions << JsonWorld::PropertyDefinition.new(
    property_name: property_name,
    **options.merge(
      parent: self,
    )
  )
end