Giter VIP home page Giter VIP logo

ambry's People

Contributors

esad avatar jschwindt avatar luislavena avatar nachokb avatar norman avatar parndt avatar tute avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ambry's Issues

Support read-only adapters

I'm working on a gem that would baiscally wrap lot of yaml data files using ambry, but these shouldn't be modifiable

Subclassing Ambry models

Should an ambry model be subclassed with following syntax or similar?:

require 'ambry'
require 'ambry/active_model'

class MyAppBadge < Badge
  extend Ambry::Model
  extend Ambry::ActiveModel

  field :type
end

Right now it doesn't work like that:

Badge.new.attributes # => {"id"=>nil, "name"=>nil, "level"=>nil, "image"=>nil, "description"=>nil} 
MyAppBadge.new.attributes # => {"type"=>nil} 

But following code seems to play nicer:

require 'ambry'
require 'ambry/active_model'

class MyAppBadge < Badge
  extend Ambry::Model
  extend Ambry::ActiveModel

  field *Badge.new.attributes.keys, :type
end
Badge.new.attributes.keys # => {"id"=>nil, "name"=>nil, "level"=>nil, "image"=>nil, "description"=>nil} 
MyAppBadge.new.attributes # => {"id"=>nil, "name"=>nil, "level"=>nil, "image"=>nil, "description"=>nil, "type"=>nil} 

See also merit-gem/merit#28.

Thanks!

Tute.

Implied default adapter

I think a default in-memory adapter should be implied, without the need to explicitly create one

Usage of blank?

Ambry uses blank? in few places, but has no activesupport dependency (only in development), which results in method missing exceptions. Should we add activesupport dependency or simply change few instances of blank? to nil? || empty??

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.