Class: Fontist::FontMatch

Inherits:
Object
  • Object
show all
Defined in:
lib/fontist/font_finder.rb

Overview

Result object for font matches

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, resource: nil, axes: [], format: nil, category: nil, resources: nil) ⇒ FontMatch

Returns a new instance of FontMatch.



133
134
135
136
137
138
139
140
141
# File 'lib/fontist/font_finder.rb', line 133

def initialize(name:, resource: nil, axes: [], format: nil,
               category: nil, resources: nil)
  @name = name
  @resource = resource
  @axes = axes
  @format = format
  @category = category
  @resources = resources
end

Instance Attribute Details

#axesObject (readonly)

Returns the value of attribute axes.



131
132
133
# File 'lib/fontist/font_finder.rb', line 131

def axes
  @axes
end

#categoryObject (readonly)

Returns the value of attribute category.



131
132
133
# File 'lib/fontist/font_finder.rb', line 131

def category
  @category
end

#formatObject (readonly)

Returns the value of attribute format.



131
132
133
# File 'lib/fontist/font_finder.rb', line 131

def format
  @format
end

#nameObject (readonly)

Returns the value of attribute name.



131
132
133
# File 'lib/fontist/font_finder.rb', line 131

def name
  @name
end

#resourceObject (readonly)

Returns the value of attribute resource.



131
132
133
# File 'lib/fontist/font_finder.rb', line 131

def resource
  @resource
end

#resourcesObject (readonly)

Returns the value of attribute resources.



131
132
133
# File 'lib/fontist/font_finder.rb', line 131

def resources
  @resources
end

Instance Method Details

#to_hObject



143
144
145
146
147
148
149
150
151
152
# File 'lib/fontist/font_finder.rb', line 143

def to_h
  {
    name: name,
    resource: resource,
    resources: resources,
    axes: axes,
    format: format,
    category: category,
  }.compact
end