Class: ActsAsAvatar::GithubAvatar

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/acts_as_avatar/github_avatar.rb

Instance Method Summary collapse

Instance Method Details

#random_svg_avatar(size:, github_complexity:, github_render_method:, github_rounded_circle:) ⇒ Object

Default options:

complexity: 16

redner_method: squad


16
17
18
19
20
21
# File 'lib/acts_as_avatar/github_avatar.rb', line 16

def random_svg_avatar(size:, github_complexity:, github_render_method:, github_rounded_circle:)
  source = File.join(File.expand_path("../../", File.dirname(__FILE__)), "github_avatar.js")
  js = File.read(source)
  context = ExecJS.compile(js)
  context.call("getRandomAvatar", github_complexity, github_render_method, size, github_rounded_circle)
end