require 'lazy_lazer'

class User
  include LazyLazer

  property :id, :required
  property :email, default: 'unknown@example.com'
  property :created_at, from: :creation_time_utc, with: ->(t) { Time.at(t) }
  property :age, with: :to_i
  property :twitter_handle, :nil
  property :favorite_ice_cream

  def lazer_reload
    self.fully_loaded = true # mark model as fully updated
    { favorite_ice_cream: %w[vanilla strawberry chocolate].sample }
  end
end

user = User.new(id: 152, creation_time_utc: 1500000000, age: '21')

user.id             #=> 152
user.email          #=> "unknown@example.com"
user.created_at     #=> 2017-07-14 03:40:00 +0100
user.age            #=> 21
user.twitter_handle #=> nil

user.favorite_ice_cream         #=> "chocolate"
user.favorite_ice_cream         #=> "chocolate"
user.reload.favorite_ice_cream  #=> "vanilla"

docs - mit licensed - created for redd - logo font is zaguatica