Class: Thingiverse::Tags

Inherits:
Object
  • Object
show all
Includes:
DynamicAttributes
Defined in:
lib/thingiverse/tags.rb

Instance Attribute Summary

Attributes included from DynamicAttributes

#attributes

Class Method Summary collapse

Instance Method Summary collapse

Methods included from DynamicAttributes

#add_attribute, #eigenclass, #initialize, #method_missing

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Thingiverse::DynamicAttributes

Class Method Details

.find(tag_name) ⇒ Object



5
6
7
8
9
# File 'lib/thingiverse/tags.rb', line 5

def self.find(tag_name)
  response = Thingiverse::Connection.get("/tags/#{tag_name}")
  raise "#{response.code}: #{JSON.parse(response.body)['error']}" unless response.success?
  self.new response.parsed_response
end

Instance Method Details

#things(query = {}) ⇒ Object



11
12
13
# File 'lib/thingiverse/tags.rb', line 11

def things(query = {})
  Thingiverse::Pagination.new(Thingiverse::Connection.get(things_url, :query => query), Thingiverse::Things)
end