Skip to content

A simple gem providing a dsl for defining and initializing class fields

License

Notifications You must be signed in to change notification settings

alehander92/fugazi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#fugazi

A simple gem providing a dsl for defining and initializing class fields

example

class Box
  include Fugazi

  fields :content
  defaults x: 0, y: 0
  keywords z: 0
end

# <=>
class Box
  attr_reader :content, :x, :y, :z

  def initialize(content, x = 0, y = 0, z: 0)
    @content = content
    @x = x
    @y = y
    @z = z
  end
end

##implementation fugazi saves the arg labels and default values in class inst variables and combines them with args in #initialize

##todo

block support error handling

About

A simple gem providing a dsl for defining and initializing class fields

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages