Class: Scrapbooker::Services::TwitterFeed

Inherits:
Object
  • Object
show all
Defined in:
lib/scrapbooker/services/twitter_feed.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ TwitterFeed

Returns a new instance of TwitterFeed.



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/scrapbooker/services/twitter_feed.rb', line 20

def initialize(options)
  @active = options ? true : false
  options ||= {}
  options = self.class.default_options.merge(options)
  @username = options[:username]
  @include_retweets = options[:include_retweets]
  @exclude_replies = options[:exclude_replies]
  @include_entities = options[:include_entities]
  @count = options[:count]
  @trim_user = options[:trim_user]
end

Instance Attribute Details

#activeObject (readonly)

Returns the value of attribute active.



18
19
20
# File 'lib/scrapbooker/services/twitter_feed.rb', line 18

def active
  @active
end

#countObject (readonly)

Returns the value of attribute count.



18
19
20
# File 'lib/scrapbooker/services/twitter_feed.rb', line 18

def count
  @count
end

#exclude_repliesObject (readonly)

Returns the value of attribute exclude_replies.



18
19
20
# File 'lib/scrapbooker/services/twitter_feed.rb', line 18

def exclude_replies
  @exclude_replies
end

#include_entitiesObject (readonly)

Returns the value of attribute include_entities.



18
19
20
# File 'lib/scrapbooker/services/twitter_feed.rb', line 18

def include_entities
  @include_entities
end

#include_retweetsObject (readonly)

Returns the value of attribute include_retweets.



18
19
20
# File 'lib/scrapbooker/services/twitter_feed.rb', line 18

def include_retweets
  @include_retweets
end

#trim_userObject (readonly)

Returns the value of attribute trim_user.



18
19
20
# File 'lib/scrapbooker/services/twitter_feed.rb', line 18

def trim_user
  @trim_user
end

#usernameObject (readonly)

Returns the value of attribute username.



18
19
20
# File 'lib/scrapbooker/services/twitter_feed.rb', line 18

def username
  @username
end

Class Method Details

.default_optionsObject



7
8
9
10
11
12
13
14
15
16
# File 'lib/scrapbooker/services/twitter_feed.rb', line 7

def self.default_options
  @default_options ||= {
    :username               => nil,
    :include_retweets       => true,
    :exclude_replies        => true,
    :include_entities       => true,
    :count                  => 20,
    :trim_user              => true
  }
end