Class: Tweethook::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/tweethook/result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Result

Returns a new instance of Result.



5
6
7
8
# File 'lib/tweethook/result.rb', line 5

def initialize(args)
  args.each { |key,value| instance_variable_set("@#{key}",value)  }
  change_boolean_values    
end

Instance Attribute Details

#is_replyObject

Returns the value of attribute is_reply.



3
4
5
# File 'lib/tweethook/result.rb', line 3

def is_reply
  @is_reply
end

#is_retweetObject

Returns the value of attribute is_retweet.



3
4
5
# File 'lib/tweethook/result.rb', line 3

def is_retweet
  @is_retweet
end

#mentionsObject

Returns the value of attribute mentions.



3
4
5
# File 'lib/tweethook/result.rb', line 3

def mentions
  @mentions
end

#search_queryObject

Returns the value of attribute search_query.



3
4
5
# File 'lib/tweethook/result.rb', line 3

def search_query
  @search_query
end

#sourceObject

Returns the value of attribute source.



3
4
5
# File 'lib/tweethook/result.rb', line 3

def source
  @source
end

Returns the value of attribute sourcelink.



3
4
5
# File 'lib/tweethook/result.rb', line 3

def sourcelink
  @sourcelink
end

#tidObject

Returns the value of attribute tid.



3
4
5
# File 'lib/tweethook/result.rb', line 3

def tid
  @tid
end

#tstampObject

Returns the value of attribute tstamp.



3
4
5
# File 'lib/tweethook/result.rb', line 3

def tstamp
  @tstamp
end

#tweetObject

Returns the value of attribute tweet.



3
4
5
# File 'lib/tweethook/result.rb', line 3

def tweet
  @tweet
end

#unix_tstampObject

Returns the value of attribute unix_tstamp.



3
4
5
# File 'lib/tweethook/result.rb', line 3

def unix_tstamp
  @unix_tstamp
end

#userObject

Returns the value of attribute user.



3
4
5
# File 'lib/tweethook/result.rb', line 3

def user
  @user
end

#usrimgObject

Returns the value of attribute usrimg.



3
4
5
# File 'lib/tweethook/result.rb', line 3

def usrimg
  @usrimg
end

Instance Method Details

#change_boolean_valuesObject



10
11
12
13
# File 'lib/tweethook/result.rb', line 10

def change_boolean_values
  @is_reply = !@is_reply.zero?
  @is_retweet = !@is_retweet.zero?
end

#reply?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/tweethook/result.rb', line 15

def reply?
  @is_reply
end

#retweet?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/tweethook/result.rb', line 19

def retweet?
  @is_retweet
end