Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decide on card and atom API #7

Open
elucid opened this issue Jan 8, 2016 · 0 comments
Open

Decide on card and atom API #7

elucid opened this issue Jan 8, 2016 · 0 comments

Comments

@elucid
Copy link
Owner

elucid commented Jan 8, 2016

Cards and atoms are currently both implemented as modules with #name, #type, and #render defined as module_functions.

This isn't great Ruby style. Here are some alternatives:

  • using classes instead of modules would require class-level method definitions of #name and #type so that searching and validation work in a reasonable way. this is kind of messy but would be somewhat nicer if card and atom base classes were provided (possibly using something like cattr_accessor for #name...)
  • using a hash with render being a callable. this seems sloppy.

Also, I'm not in love with the long method signatures for render. Considering switching to

  def render(*args)
    env = args[:env]
    value = args[:value]
    ...
  end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant