Class: Aro::P

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/aro/prompt.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeP

Returns a new instance of P.



9
10
11
# File 'lib/aro/prompt.rb', line 9

def initialize
  self.prompt = TTY::Prompt.new
end

Instance Attribute Details

#promptObject

Returns the value of attribute prompt.



7
8
9
# File 'lib/aro/prompt.rb', line 7

def prompt
  @prompt
end

Class Method Details

.less(display_text = "") ⇒ Object



21
22
23
# File 'lib/aro/prompt.rb', line 21

def self.less(display_text = "")
  IO.popen("less -X", "w") { |f| f.puts display_text }
end

.pObject



13
14
15
# File 'lib/aro/prompt.rb', line 13

def self.p
  P.instance.prompt
end

.say(message) ⇒ Object



17
18
19
# File 'lib/aro/prompt.rb', line 17

def self.say(message)
  Aro::P::p.say(">[#{Aro::Mancy::PS1}::#{Time.now.to_i}]>: #{message}")
end