Class: BEL::Language::Function

Inherits:
Object
  • Object
show all
Defined in:
lib/bel/language.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Function

Returns a new instance of Function.



48
49
50
51
52
# File 'lib/bel/language.rb', line 48

def initialize args
  args.each do |k,v|
    instance_variable_set("@#{k}", v) unless v.nil?
  end
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



45
46
47
# File 'lib/bel/language.rb', line 45

def description
  @description
end

#long_formObject (readonly)

Returns the value of attribute long_form.



45
46
47
# File 'lib/bel/language.rb', line 45

def long_form
  @long_form
end

#return_typeObject (readonly)

Returns the value of attribute return_type.



45
46
47
# File 'lib/bel/language.rb', line 45

def return_type
  @return_type
end

#short_formObject (readonly)

Returns the value of attribute short_form.



45
46
47
# File 'lib/bel/language.rb', line 45

def short_form
  @short_form
end

#signaturesObject (readonly)

Returns the value of attribute signatures.



45
46
47
# File 'lib/bel/language.rb', line 45

def signatures
  @signatures
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



62
63
64
65
66
67
68
69
# File 'lib/bel/language.rb', line 62

def ==(other)
  return false if other == nil
  @short_form == other.short_form &&
  @long_form == other.long_form &&
  @return_type == other.return_type &&
  @description == other.description &&
  @signatures == other.signatures
end

#[](key) ⇒ Object



54
55
56
# File 'lib/bel/language.rb', line 54

def [](key)
  instance_variable_get("@#{key}")
end

#hashObject



58
59
60
# File 'lib/bel/language.rb', line 58

def hash
  [@short_form, @long_form, @return_type, @description, @signatures].hash
end

#to_sObject



77
78
79
# File 'lib/bel/language.rb', line 77

def to_s
  @long_form.to_s
end

#to_symObject



73
74
75
# File 'lib/bel/language.rb', line 73

def to_sym
  @short_form
end