class Arx::Category
Entity/model representing an arXiv paper's category.
Constants
- ATTRIBUTES
The attributes of an arXiv paper's category.
Public Instance Methods
==(category)
click to toggle source
Equality check against another category.
@param category [Category] The category to compare against. @return [Boolean]
# File lib/arx/entities/category.rb, line 52 def ==(category) if category.is_a? Category name == category.name else false end end
as_json()
click to toggle source
full_name()
click to toggle source
The full name of the category.
@see CATEGORIES @return [String]
# File lib/arx/entities/category.rb, line 23 def full_name CATEGORIES[name] end
to_h()
click to toggle source
Serializes the {Category} object into a Hash
.
@return [Hash]
# File lib/arx/entities/category.rb, line 30 def to_h Hash[*ATTRIBUTES.map {|_| [_, send(_)]}.flatten(1)] end
to_json()
click to toggle source
to_s()
click to toggle source
A string representation of the {Category} object.
@return [String]
# File lib/arx/entities/category.rb, line 63 def to_s "Arx::Category(name: #{name}, full_name: #{full_name || 'nil'})" end