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.



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

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.



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

def description
  @description
end

#long_formObject (readonly)

Returns the value of attribute long_form.



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

def long_form
  @long_form
end

#return_typeObject (readonly)

Returns the value of attribute return_type.



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

def return_type
  @return_type
end

#short_formObject (readonly)

Returns the value of attribute short_form.



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

def short_form
  @short_form
end

#signaturesObject (readonly)

Returns the value of attribute signatures.



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

def signatures
  @signatures
end

Instance Method Details

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



72
73
74
75
76
77
78
79
# File 'lib/bel/language.rb', line 72

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



64
65
66
# File 'lib/bel/language.rb', line 64

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

#hashObject



68
69
70
# File 'lib/bel/language.rb', line 68

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

#to_sObject



87
88
89
# File 'lib/bel/language.rb', line 87

def to_s
  @long_form.to_s
end

#to_symObject



83
84
85
# File 'lib/bel/language.rb', line 83

def to_sym
  @short_form
end