Class: Squash::Java::Argument
- Inherits:
-
Object
- Object
- Squash::Java::Argument
- Defined in:
- lib/squash/java/namespace.rb
Overview
Instance Attribute Summary collapse
-
#array ⇒ true, false
(also: #array?)
readonly
‘true` if the argument is an array, false if it is a scalar.
-
#type ⇒ Squash::Java::Type
readonly
The argument type.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(type, array = false) ⇒ Argument
constructor
A new instance of Argument.
- #inspect ⇒ Object
-
#to_s ⇒ String
The type’s full name, with “[]” appended for arrays.
Constructor Details
#initialize(type, array = false) ⇒ Argument
Returns a new instance of Argument.
533 534 535 536 |
# File 'lib/squash/java/namespace.rb', line 533 def initialize(type, array=false) @type = type @array = array end |
Instance Attribute Details
#array ⇒ true, false (readonly) Also known as: array?
Returns ‘true` if the argument is an array, false if it is a scalar.
529 530 531 |
# File 'lib/squash/java/namespace.rb', line 529 def array @array end |
#type ⇒ Squash::Java::Type (readonly)
Returns The argument type.
525 526 527 |
# File 'lib/squash/java/namespace.rb', line 525 def type @type end |
Instance Method Details
#==(other) ⇒ Object
539 540 541 542 543 |
# File 'lib/squash/java/namespace.rb', line 539 def ==(other) other.kind_of?(Squash::Java::Argument) && type == other.type && array? == other.array? end |
#inspect ⇒ Object
549 |
# File 'lib/squash/java/namespace.rb', line 549 def inspect() "#<#{self.class} #{to_s}>" end |
#to_s ⇒ String
Returns The type’s full name, with “[]” appended for arrays.
546 |
# File 'lib/squash/java/namespace.rb', line 546 def to_s() "#{type.full_name}#{'[]' if array?}" end |