Skip to content

lpogic/modeling

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

modeling - A concise way to define the class shape

Adds the ability to quickly model classes. Definitions of instance variables and access methods are reduced to one line. Creating an instance of the modeled class is significantly slower (~20x), so its use for classes whose instances are created frequently is not recommended.

Basics

require 'modeling'

# with modeling:

class Foo
  model :first, :@R_second
end

# without modeling:

class Foo
  def initialize first, second
    @first = first
    @second = second
  end

  attr_accessor :first
  attr_reader :second
end

Installation

gem install modeling

Usage

Wiki

Authors

About

Drier class definitions

Resources

Stars

Watchers

Forks

Languages