Class: Point::Zone

Inherits:
Base
  • Object
show all
Defined in:
lib/point/zone.rb

Instance Attribute Summary

Attributes inherited from Base

#attributes, #errors, #id

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

class_name, #create, #destroy, find, find_all, find_single, member_path, #method_missing, #new_record?, #post, post, #save, #update

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Point::Base

Class Method Details

.collection_path(params = {}) ⇒ Object



5
6
7
# File 'lib/point/zone.rb', line 5

def collection_path(params = {})
  params[:group] ? "zones?group=#{params[:group]}" : 'zones'
end

Instance Method Details

#apply!Object



10
11
12
13
# File 'lib/point/zone.rb', line 10

def apply!
  $stderr.puts "Zone information does not need to be applied manually. Point::Zone#apply! method will be deprecated soon."
  true
end

#build_record(attributes = {}) ⇒ Object



23
24
25
26
27
28
# File 'lib/point/zone.rb', line 23

def build_record(attributes = {})
  z = ZoneRecord.new
  z.attributes = attributes if attributes.is_a?(Hash)
  z.zone = self
  z
end

#record(id) ⇒ Object



19
20
21
# File 'lib/point/zone.rb', line 19

def record(id)
  ZoneRecord.find(id, :zone => self)
end

#recordsObject



15
16
17
# File 'lib/point/zone.rb', line 15

def records
  ZoneRecord.find(:all, :zone => self)
end

#requires_update?Boolean

Returns:

  • (Boolean)


30
31
32
33
# File 'lib/point/zone.rb', line 30

def requires_update?
  $stderr.puts "Zone updated are applied immediately. Point::Zone#requires_update? will be deprecated soon."
  false
end