Class: Fluxiom::Assets

Inherits:
Fluxiom show all
Includes:
Enumerable
Defined in:
lib/fluxapi/assets.rb

Instance Attribute Summary

Attributes inherited from Fluxiom

#base_url

Instance Method Summary collapse

Methods inherited from Fluxiom

#account, #assets, call, post_call, #tags, #users

Constructor Details

#initializeAssets

Returns a new instance of Assets.



3
4
5
6
7
8
# File 'lib/fluxapi/assets.rb', line 3

def initialize
  @assets = []
  self.class.call('/api/assets.xml')['documents'].each do |v|
    @assets << Fluxiom::Asset.new(v)
  end
end

Instance Method Details

#eachObject



9
10
11
# File 'lib/fluxapi/assets.rb', line 9

def each
  @assets.each {|pt| yield pt} 
end

#find(id) ⇒ Object



15
16
17
# File 'lib/fluxapi/assets.rb', line 15

def find(id)
  @assets.find {|a| a.id == id }
end

#firstObject



12
13
14
# File 'lib/fluxapi/assets.rb', line 12

def first
  @assets.first
end