class NDFRT::Concept

Attributes

kind[RW]
name[RW]
nui[RW]

Public Class Methods

new(concept_hash) click to toggle source
# File lib/ndfrt/concept.rb, line 5
def initialize concept_hash
  unless [:concept_name, :concept_nui, :concept_kind].all? { |k| concept_hash.has_key? k }
    raise ArgumentError, "You must supply a hash with the conecept's name, nui and kind"
  end
  @name = concept_hash[:concept_name].capitalize
  @nui  = concept_hash[:concept_nui]
  @kind = titleize_kind concept_hash[:concept_kind]
end

Public Instance Methods

==(concept) click to toggle source
# File lib/ndfrt/concept.rb, line 18
def == concept
  self.instance_variables.each do |i|
    equal = (self.instance_variable_get(i) == concept.instance_variable_get(i))
    return equal if !equal
  end
  true
end
extended_info()
extended_information() click to toggle source
# File lib/ndfrt/concept.rb, line 26
def extended_information
  NDFRT.new.get_info self.nui
end
Also aliased as: extended_info
to_s() click to toggle source
# File lib/ndfrt/concept.rb, line 14
def to_s
  name
end

Private Instance Methods

titleize_kind(str) click to toggle source
# File lib/ndfrt/concept.rb, line 33
def titleize_kind str
  str.split("_")[0...-1].map(&:capitalize).join(" ") if str.is_a? String
end