Class: RubyIdentifier

Inherits:
Object
  • Object
show all
Defined in:
lib/pry-globs/ruby_identifier.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cli_args, identifier_table) ⇒ RubyIdentifier

Returns a new instance of RubyIdentifier.



4
5
6
7
# File 'lib/pry-globs/ruby_identifier.rb', line 4

def initialize(cli_args, identifier_table)
  @token_table = identifier_table
  @cli_args = cli_args
end

Instance Attribute Details

#cli_argsObject (readonly)

Returns the value of attribute cli_args.



2
3
4
# File 'lib/pry-globs/ruby_identifier.rb', line 2

def cli_args
  @cli_args
end

#token_tableObject (readonly)

Returns the value of attribute token_table.



2
3
4
# File 'lib/pry-globs/ruby_identifier.rb', line 2

def token_table
  @token_table
end

Instance Method Details

#absent_from_table?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/pry-globs/ruby_identifier.rb', line 13

def absent_from_table?
  token_data.nil?
end

#absent_msgObject



17
18
19
# File 'lib/pry-globs/ruby_identifier.rb', line 17

def absent_msg
  absent_from_table? ? "There is no information about '#{token}'.\n\nPlease submit data and open a PR!\n" : ''
end

#descriptionObject



9
10
11
# File 'lib/pry-globs/ruby_identifier.rb', line 9

def description
  definition + explanation
end