class Carbonculture::Place

Attributes

body[RW]
data[RW]
name[RW]
organisation_name[RW]

Public Class Methods

new(name, org_name) click to toggle source
# File lib/carbonculture/place.rb, line 6
def initialize(name, org_name)
  self.name = name
  self.organisation_name = org_name
  self.data = self.class.get "#{ BASE_URL }/#{ org_name }/#{ name }"

  self.body = JSON.parse(self.data.body)
  raise ArgumentError if status == 'fail'

end

Public Instance Methods

channels(options = {}) click to toggle source
# File lib/carbonculture/place.rb, line 20
def channels(options = {})
  body['channels'].map { |c| Channel.new(c, name, organisation_name, options) }
end
method_missing(method_name, *args, &block) click to toggle source
Calls superclass method
# File lib/carbonculture/place.rb, line 24
def method_missing(method_name, *args, &block)
  if body.has_key?(method_name.to_s)
    body[method_name.to_s]
  else
    super
  end
end
organisation() click to toggle source
# File lib/carbonculture/place.rb, line 16
def organisation
  Organisation.new(organisation_name)
end