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.



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

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)


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

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)


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

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.



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

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