1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/joyent/models/analytics/fields.rb
Kevin Olbrich 955824d00c fields
2014-01-21 16:24:22 +00:00

26 lines
615 B
Ruby

require 'fog/joyent/models/analytics/field'
module Fog
module Joyent
class Analytics
class Fields < Fog::Collection
model Fog::Joyent::Analytics::Field
def all
data = service.describe_analytics.body['fields']
load(data)
end
# Joyent returns an odd data structure like this:
# { 'apache' => {'label' => 'Apache'}}
# where the key is the name of the module
def new(attributes = {})
name, other_attributes = attributes
super(other_attributes.merge('name' => name))
end
end
end
end
end