Class: Plugins::Seen::SeenStruct

Inherits:
Struct
  • Object
show all
Includes:
ActionView::Helpers::DateHelper
Defined in:
lib/Zeta/plugins/seen.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#timeObject

Returns the value of attribute time

Returns:

  • (Object)

    the current value of time



4
5
6
# File 'lib/Zeta/plugins/seen.rb', line 4

def time
  @time
end

#whatObject

Returns the value of attribute what

Returns:

  • (Object)

    the current value of what



4
5
6
# File 'lib/Zeta/plugins/seen.rb', line 4

def what
  @what
end

#whereObject

Returns the value of attribute where

Returns:

  • (Object)

    the current value of where



4
5
6
# File 'lib/Zeta/plugins/seen.rb', line 4

def where
  @where
end

#whoObject

Returns the value of attribute who

Returns:

  • (Object)

    the current value of who



4
5
6
# File 'lib/Zeta/plugins/seen.rb', line 4

def who
  @who
end

Instance Method Details

#to_sObject



6
7
8
9
10
# File 'lib/Zeta/plugins/seen.rb', line 6

def to_s
  # "[#{time.asctime}] #{who} was seen in #{where} last saying #{what}"
  time_ago = time_ago_in_words(Time.at(time))
  "[ \x1F#{where.to_s.upcase}\x0F ] \x0304#{who}\x0F: \"\x0303#{what[0..300]}\x0F\" \x02#{time_ago}\x0F ago"
end