Module: Tigre::TagComponents

Included in:
Sample, Url
Defined in:
lib/tigre-client/common/tag_components.rb

Instance Method Summary collapse

Instance Method Details

#not_tagged(options = {}) ⇒ Object

optional params

options => Hash
  :after  => Ruby DateTime object OR Integer (epoch time)
  :before => Ruby DateTime object OR Integer (epoch time)
  :page => Integer, :default => 0
  :per => Integer, :default => 50


65
66
67
68
# File 'lib/tigre-client/common/tag_components.rb', line 65

def not_tagged(options={})
  common_params(options)
  Tigre.get_connection("/#{get_klass}/not_tagged?#{before_after_page_per}")
end

#not_tagged_with(tags, options = {}) ⇒ Object

required params

tags => String => I.E 'foo'
tags => String (comma seperated) => I.E 'foo,bar,baz'
tags => Array => ['foo', 'bar', 'baz']

optional params

options => Hash
  :after  => Ruby DateTime object OR Integer (epoch time)
  :before => Ruby DateTime object OR Integer (epoch time)
  :page => Integer, :default => 0
  :per => Integer, :default => 50


49
50
51
52
53
54
55
56
57
# File 'lib/tigre-client/common/tag_components.rb', line 49

def not_tagged_with(tags, options={})
  if tags == ''
    raise "Missing tags parameter"
  end

  tags = package_array_list(tags)
  common_params(options)
  Tigre.get_connection("/#{get_klass}/not_tagged_with?tags=#{tags}&#{before_after_page_per}")
end

#remove_tags(hash) ⇒ Object

required params

hash   => Hash
  :digest => String,  The digest type
  :value  => String,  The digest value
  :tag_list => String (comma seperated) => I.E 'foo,bar,baz'
  :tag_list => Array => ['foo', 'bar', 'baz']


30
31
32
33
34
35
36
37
# File 'lib/tigre-client/common/tag_components.rb', line 30

def remove_tags(hash)
  unless hash[:digest] && hash[:value] && hash[:tag_list]
    raise 'Missing parameter :digest or :value or :tag_list'
  end
  
  update_data = {"tag_list" => package_array_list(hash[:tag_list])}
  Tigre.put_connection("/#{get_klass}/#{hash[:digest]}/value/#{hash[:value]}/remove_tags", update_data)
end

#tagged_count(tags, options = {}) ⇒ Object

required params

tags => String => I.E 'foo'
tags => String (comma seperated) => I.E 'foo,bar,baz'
tags => Array => ['foo', 'bar', 'baz']

optional params

options => Hash
  :after  => Ruby DateTime object OR Integer (epoch time)
  :before => Ruby DateTime object OR Integer (epoch time)


78
79
80
81
82
83
84
85
86
# File 'lib/tigre-client/common/tag_components.rb', line 78

def tagged_count(tags, options={})
  if tags == ''
    raise "Missing tags parameter"
  end
  
  tags = package_array_list(tags)
  common_params(options)
  Tigre.get_connection("/#{get_klass}/tagged_with?tags=#{tags}&#{before_after}")
end

#tagged_with(tags, options = {}) ⇒ Object

required params

tags => String => I.E 'foo'
tags => String (comma seperated) => I.E 'foo,bar,baz'
tags => Array => ['foo', 'bar', 'baz']

optional params

options => Hash
  :after  => Ruby DateTime object OR Integer (epoch time)
  :before => Ruby DateTime object OR Integer (epoch time)
  :page => Integer, :default => 0
  :per => Integer, :default => 50


14
15
16
17
18
19
20
21
22
# File 'lib/tigre-client/common/tag_components.rb', line 14

def tagged_with(tags, options={})
  if tags == ''
    raise "Missing tags parameter"
  end

  common_params(options)
  tags = package_array_list(tags)
  Tigre.get_connection("/#{get_klass}/tagged_with?tags=#{tags}&#{before_after_page_per}")
end