Class: ActsAsAvatar::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/acts_as_avatar/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/acts_as_avatar/configuration.rb', line 36

def initialize
  @uifaces_uri           = "https://api.uifaces.co"
  @uifaces_api_key       = "72694e5b5dee4706edc0acad3d4291"
  @uifaces_gender        = nil
  @uifaces_limit         = 72
  @random_image_engine   = nil
  @default_file_name     = "default_avatar"
  @upload_max_size       = 2.megabytes
  @class_type            = %w[User]
  @avatar_name           = :name
  @inline_svg_engine     = :initial_avatar
  @avatar_size           = 60
  @github_complexity     = 5
  @github_render_method  = "square"
  @github_rounded_circle = false
end

Instance Attribute Details

#avatar_nameObject

Returns the value of attribute avatar_name.



21
22
23
# File 'lib/acts_as_avatar/configuration.rb', line 21

def avatar_name
  @avatar_name
end

#avatar_sizeObject

Returns the value of attribute avatar_size.



21
22
23
# File 'lib/acts_as_avatar/configuration.rb', line 21

def avatar_size
  @avatar_size
end

#class_typeObject

Returns the value of attribute class_type.



21
22
23
# File 'lib/acts_as_avatar/configuration.rb', line 21

def class_type
  @class_type
end

#default_file_nameObject

Returns the value of attribute default_file_name.



21
22
23
# File 'lib/acts_as_avatar/configuration.rb', line 21

def default_file_name
  @default_file_name
end

#github_complexityObject

Returns the value of attribute github_complexity.



21
22
23
# File 'lib/acts_as_avatar/configuration.rb', line 21

def github_complexity
  @github_complexity
end

#github_render_methodObject

Returns the value of attribute github_render_method.



21
22
23
# File 'lib/acts_as_avatar/configuration.rb', line 21

def github_render_method
  @github_render_method
end

#github_rounded_circleObject

Returns the value of attribute github_rounded_circle.



21
22
23
# File 'lib/acts_as_avatar/configuration.rb', line 21

def github_rounded_circle
  @github_rounded_circle
end

#inline_svg_engineObject

Returns the value of attribute inline_svg_engine.



21
22
23
# File 'lib/acts_as_avatar/configuration.rb', line 21

def inline_svg_engine
  @inline_svg_engine
end

#random_image_engineObject

Returns the value of attribute random_image_engine.



21
22
23
# File 'lib/acts_as_avatar/configuration.rb', line 21

def random_image_engine
  @random_image_engine
end

#uifaces_api_keyObject

Returns the value of attribute uifaces_api_key.



21
22
23
# File 'lib/acts_as_avatar/configuration.rb', line 21

def uifaces_api_key
  @uifaces_api_key
end

#uifaces_genderObject

Returns the value of attribute uifaces_gender.



21
22
23
# File 'lib/acts_as_avatar/configuration.rb', line 21

def uifaces_gender
  @uifaces_gender
end

#uifaces_limitObject

Returns the value of attribute uifaces_limit.



21
22
23
# File 'lib/acts_as_avatar/configuration.rb', line 21

def uifaces_limit
  @uifaces_limit
end

#uifaces_uriObject

Returns the value of attribute uifaces_uri.



21
22
23
# File 'lib/acts_as_avatar/configuration.rb', line 21

def uifaces_uri
  @uifaces_uri
end

#upload_max_sizeObject

Returns the value of attribute upload_max_size.



21
22
23
# File 'lib/acts_as_avatar/configuration.rb', line 21

def upload_max_size
  @upload_max_size
end

Instance Method Details

#default_optionsObject



53
54
55
56
57
# File 'lib/acts_as_avatar/configuration.rb', line 53

def default_options
  instance_variables.to_h do |key|
    [key.to_s.sub("@", "").to_sym, instance_variable_get(key)]
  end
end