Class: Blingee::Instance
- Inherits:
-
Object
- Object
- Blingee::Instance
- Defined in:
- lib/blingee/instance.rb
Instance Method Summary collapse
-
#initialize(options) ⇒ Instance
constructor
A new instance of Instance.
-
#tag_search(tags = '') ⇒ Object
Search Blingee for graphics matching the given tags.
Constructor Details
#initialize(options) ⇒ Instance
Returns a new instance of Instance.
5 6 7 8 9 |
# File 'lib/blingee/instance.rb', line 5 def initialize() = HashWithIndifferentAccess.new() @user_id = [:user_id] || raise(ArgumentError, "Blingee user_id is required") @secret = [:secret] || raise(ArgumentError, "Blingee secret is required") end |
Instance Method Details
#tag_search(tags = '') ⇒ Object
Search Blingee for graphics matching the given tags.
blingee.search('miley,cyrus,myley cyrus')
blingee.search(['miley','cyrus','myley cyrus'])
17 18 19 20 |
# File 'lib/blingee/instance.rb', line 17 def tag_search( = '') = .join(',') if .respond_to?(:join) objectize(api.request { api.search(:tags => , :api_timestamp => Time.now.to_i, :api_signature => API.generate_signature({:api_user_id => @user_id, :tags => , :api_timestamp => Time.now.to_i}, @secret)) }) end |