Class: Stenographer::Transcript
- Inherits:
-
Object
- Object
- Stenographer::Transcript
- Defined in:
- lib/stenographer/transcript.rb
Instance Attribute Summary collapse
-
#conversations ⇒ Object
Returns the value of attribute conversations.
Instance Method Summary collapse
-
#initialize(dir = nil) ⇒ Transcript
constructor
A new instance of Transcript.
- #read_back(opts = {}) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(dir = nil) ⇒ Transcript
Returns a new instance of Transcript.
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/stenographer/transcript.rb', line 6 def initialize(dir=nil) dir ||= "/Users/#{`whoami`.strip}/Library/Application\ Support/Adium\ 2.0/Users/default/Logs/**/*.xml" @conversations = [] Dir.glob(dir).each_with_index do |file, i| doc = Nokogiri.XML(File.open(File.(file), 'rb')) conversation = Conversation.new(i, doc) next unless conversation..any? @conversations << conversation end end |
Instance Attribute Details
#conversations ⇒ Object
Returns the value of attribute conversations.
4 5 6 |
# File 'lib/stenographer/transcript.rb', line 4 def conversations @conversations end |
Instance Method Details
#read_back(opts = {}) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/stenographer/transcript.rb', line 19 def read_back(opts={}) conversations.each do |conversation| conversation.read_back(opts) end self end |
#to_s ⇒ Object
27 28 29 |
# File 'lib/stenographer/transcript.rb', line 27 def to_s "Transcript <conversations: #{conversations.length}>" end |