Sha256: e827f224069f30be098c5cd1f60c0b2e95bb94524188548b122f4b5f4e0acfc6

Contents?: true

Size: 381 Bytes

Versions: 14

Compression:

Stored size: 381 Bytes

Contents

require 'opal'
require 'user'
require 'native'

module MyApp
  class Application
    attr_reader :user

    def initialize
      @user = User.new('Bill')
      @user.authenticated?
    rescue
      @user = User.new('Bob')
      @user.authenticated?
      p @user
    end
  end
end

$app = MyApp::Application.new

p $app
puts "Done!"

$$.document.write("user is #{$app.user.name}")

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
opal-sprockets-1.0.4 example/app/application.rb
opal-sprockets-1.0.3 example/app/application.rb
opal-sprockets-1.0.2 example/app/application.rb
opal-sprockets-1.0.1 example/app/application.rb
opal-sprockets-1.0.0 example/app/application.rb
opal-sprockets-0.4.9.1.0.3.7 example/app/application.rb
opal-sprockets-0.4.8.1.0.3.7 example/app/application.rb
opal-sprockets-0.4.7.1.0.3.7 example/app/application.rb
opal-sprockets-0.4.6.1.0.3.7 example/app/application.rb
opal-sprockets-0.4.5.1.0.3.7 example/app/application.rb
opal-sprockets-0.4.4.1.0.3.7 example/app/application.rb
opal-sprockets-0.4.3.0.11.0.3.7 example/app/application.rb
opal-sprockets-0.4.2.0.11.0.3.1 example/app/application.rb
opal-sprockets-0.4.2.pre.1.0.11.0.3.1 example/app/application.rb