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.
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
#description ⇒ Object (readonly)
Returns the value of attribute description.
45 46 47 |
# File 'lib/bel/language.rb', line 45 def description @description end |
#long_form ⇒ Object (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_type ⇒ Object (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_form ⇒ Object (readonly)
Returns the value of attribute short_form.
45 46 47 |
# File 'lib/bel/language.rb', line 45 def short_form @short_form end |
#signatures ⇒ Object (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 |
#hash ⇒ Object
58 59 60 |
# File 'lib/bel/language.rb', line 58 def hash [@short_form, @long_form, @return_type, @description, @signatures].hash end |
#to_s ⇒ Object
77 78 79 |
# File 'lib/bel/language.rb', line 77 def to_s @long_form.to_s end |
#to_sym ⇒ Object
73 74 75 |
# File 'lib/bel/language.rb', line 73 def to_sym @short_form end |