mogli 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/mogli/model.rb +6 -0
- data/lib/mogli/page.rb +10 -2
- metadata +2 -2
data/lib/mogli/model.rb
CHANGED
@@ -88,6 +88,12 @@ module Mogli
|
|
88
88
|
add_creation_method(name,klass)
|
89
89
|
end
|
90
90
|
|
91
|
+
def fetch
|
92
|
+
raise ArgumentError.new("You cannot fetch models without a populated id attribute") if id.nil?
|
93
|
+
other = self.class.find(id,client)
|
94
|
+
merge!(other)
|
95
|
+
end
|
96
|
+
|
91
97
|
def self.recognize?(data)
|
92
98
|
true
|
93
99
|
end
|
data/lib/mogli/page.rb
CHANGED
@@ -1,12 +1,20 @@
|
|
1
1
|
module Mogli
|
2
2
|
class Page < Profile
|
3
3
|
|
4
|
-
define_properties :id, :name, :category
|
4
|
+
define_properties :id, :name, :category, :username
|
5
5
|
|
6
|
+
# General
|
7
|
+
define_properties :fan_count, :link, :picture, :has_added_app
|
8
|
+
|
9
|
+
# Retail
|
10
|
+
define_properties :founded, :products, :mission, :company_overview
|
11
|
+
|
12
|
+
# Musicians
|
13
|
+
define_properties :record_label, :hometown, :band_members, :genre
|
6
14
|
|
7
15
|
def self.recognize?(hash)
|
8
16
|
hash.has_key?("category")
|
9
17
|
end
|
10
18
|
|
11
19
|
end
|
12
|
-
end
|
20
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mogli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Mangino
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-05-
|
12
|
+
date: 2010-05-06 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|