Module: FinerStruct

Defined in:
lib/finer_struct/named.rb,
lib/finer_struct/mutable.rb,
lib/finer_struct/version.rb,
lib/finer_struct/immutable.rb

Defined Under Namespace

Modules: Named Classes: Immutable, Mutable

Constant Summary collapse

VERSION =
"0.0.4"

Class Method Summary collapse

Class Method Details

.Immutable(*attribute_names) ⇒ Object



19
20
21
22
23
# File 'lib/finer_struct/immutable.rb', line 19

def self.Immutable(*attribute_names)
  Named.build_class(attribute_names) do
    attr_reader(*attribute_names)
  end
end

.Mutable(*attribute_names) ⇒ Object



26
27
28
29
30
# File 'lib/finer_struct/mutable.rb', line 26

def self.Mutable(*attribute_names)
  Named.build_class(attribute_names) do
    attr_accessor(*attribute_names)
  end
end