Class: ValueSemantics::Struct

Inherits:
Object
  • Object
show all
Defined in:
lib/value_semantics.rb

Overview

ValueSemantics equivalent of the Struct class from the Ruby standard library

Class Method Summary collapse

Class Method Details

.new { ... } ⇒ Class

Creates a new Class with ValueSemantics mixed in

Yields:

  • a block containing ValueSemantics DSL

Returns:

  • (Class)

    the newly created class



380
381
382
383
384
# File 'lib/value_semantics.rb', line 380

def self.new(&block)
  klass = Class.new
  klass.include(ValueSemantics.for_attributes(&block))
  klass
end