Class: ValueSemantics::Struct
- Inherits:
-
Object
- Object
- ValueSemantics::Struct
- Defined in:
- lib/value_semantics/struct.rb
Overview
ValueSemantics equivalent of the Struct class from the Ruby standard library
Class Method Summary collapse
-
.new { ... } ⇒ Class
Creates a new Class with ValueSemantics mixed in.
Class Method Details
.new { ... } ⇒ Class
Creates a new Class with ValueSemantics mixed in
13 14 15 16 17 |
# File 'lib/value_semantics/struct.rb', line 13 def self.new(&block) klass = Class.new klass.include(ValueSemantics.for_attributes(&block)) klass end |