Class: FFIDB::Parameter
- Inherits:
-
Object
- Object
- FFIDB::Parameter
- Includes:
- Comparable
- Defined in:
- lib/ffidb/parameter.rb
Instance Method Summary collapse
- #<=>(other) ⇒ Integer
-
#initialize(name, type = nil) ⇒ Parameter
constructor
A new instance of Parameter.
- #to_h ⇒ Hash<Symbol, Type>
- #to_s ⇒ String
Constructor Details
#initialize(name, type = nil) ⇒ Parameter
Returns a new instance of Parameter.
12 13 14 |
# File 'lib/ffidb/parameter.rb', line 12 def initialize(name, type = nil) super(name.to_sym, type ? Type.for(type) : nil) end |
Instance Method Details
#<=>(other) ⇒ Integer
19 20 21 |
# File 'lib/ffidb/parameter.rb', line 19 def <=>(other) self.name <=> other.name end |
#to_h ⇒ Hash<Symbol, Type>
31 32 33 |
# File 'lib/ffidb/parameter.rb', line 31 def to_h {self.name => self.type} end |
#to_s ⇒ String
25 26 27 |
# File 'lib/ffidb/parameter.rb', line 25 def to_s "#{self.name}: #{self.type}" end |