Class: Opt::Command::Token Private

Inherits:
Struct
  • Object
show all
Defined in:
lib/opt/command.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#inspectObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



278
279
280
# File 'lib/opt/command.rb', line 278

def inspect
  "<#{self.class}(#{type}):\"#{self}\">"
end

#short?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


263
264
265
# File 'lib/opt/command.rb', line 263

def short?
  type == :short
end

#text?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


259
260
261
# File 'lib/opt/command.rb', line 259

def text?
  type == :text
end

#to_sObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



267
268
269
270
271
272
273
274
275
276
# File 'lib/opt/command.rb', line 267

def to_s
  case type
    when :long
      "--#{value}"
    when :short
      "-#{value}"
    else
      value
  end
end