Class: Icons::Sprite::Reference

Inherits:
Data
  • Object
show all
Defined in:
lib/icons/sprite/reference.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#libraryObject (readonly)

Returns the value of attribute library

Returns:

  • (Object)

    the current value of library



5
6
7
# File 'lib/icons/sprite/reference.rb', line 5

def library
  @library
end

#nameObject (readonly)

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



5
6
7
# File 'lib/icons/sprite/reference.rb', line 5

def name
  @name
end

#variantObject (readonly)

Returns the value of attribute variant

Returns:

  • (Object)

    the current value of variant



5
6
7
# File 'lib/icons/sprite/reference.rb', line 5

def variant
  @variant
end

Instance Method Details

#exists?Boolean

Returns:

  • (Boolean)


16
17
18
19
20
# File 'lib/icons/sprite/reference.rb', line 16

def exists?
  File.exist?(file_path)
rescue Icons::IconNotFound
  false
end

#file_pathObject



8
9
10
11
12
13
14
# File 'lib/icons/sprite/reference.rb', line 8

def file_path
  Icons::Icon::FilePath.new(
    name: name.to_s,
    library: library.to_s,
    variant: variant.to_s
  ).call
end

#idObject



6
# File 'lib/icons/sprite/reference.rb', line 6

def id = [library, variant, name].join("_")