lib/vk/country.rb in vk-0.0.4 vs lib/vk/country.rb in vk-0.6.5.53
- old
+ new
@@ -1,18 +1,23 @@
require 'vk/base'
module Vk
class Country < Base
- self.key_field = :cid
- self.fields = [:cid, :name]
+ self.fields = [:id, :title]
+ # @return [<Vk::Region>]
+ def regions
+ @regions ||= loader.get_regions(id).all
+ end
+
+ # @return [String]
def to_s
- name
+ title.to_s
end
protected
def load_data(options = {})
- @attributes = @attributes.merge(loader.get_country(id))
+ @attributes = @attributes.merge(loader.get_country_by_id(id))
end
end
end