Class: BEL::Language::Function
- Inherits:
-
Object
- Object
- BEL::Language::Function
- Defined in:
- lib/bel/language.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#long_form ⇒ Object
readonly
Returns the value of attribute long_form.
-
#return_type ⇒ Object
readonly
Returns the value of attribute return_type.
-
#short_form ⇒ Object
readonly
Returns the value of attribute short_form.
-
#signatures ⇒ Object
readonly
Returns the value of attribute signatures.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #[](key) ⇒ Object
- #hash ⇒ Object
-
#initialize(args) ⇒ Function
constructor
A new instance of Function.
- #to_s ⇒ Object
- #to_sym ⇒ Object
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
#description ⇒ Object (readonly)
Returns the value of attribute description.
55 56 57 |
# File 'lib/bel/language.rb', line 55 def description @description end |
#long_form ⇒ Object (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_type ⇒ Object (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_form ⇒ Object (readonly)
Returns the value of attribute short_form.
55 56 57 |
# File 'lib/bel/language.rb', line 55 def short_form @short_form end |
#signatures ⇒ Object (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 |
#hash ⇒ Object
68 69 70 |
# File 'lib/bel/language.rb', line 68 def hash [@short_form, @long_form, @return_type, @description, @signatures].hash end |
#to_s ⇒ Object
87 88 89 |
# File 'lib/bel/language.rb', line 87 def to_s @long_form.to_s end |
#to_sym ⇒ Object
83 84 85 |
# File 'lib/bel/language.rb', line 83 def to_sym @short_form end |