lib/rmega/node.rb in rmega-0.0.2 vs lib/rmega/node.rb in rmega-0.0.3
- old
+ new
@@ -7,12 +7,12 @@
@data = data
end
def self.initialize_by_public_url session, public_url
public_handle, key = public_url.split('!')[1, 2]
- data = session.request a: 'g', g: 1, p: public_handle
- node = new session, data
+
+ node = new session, public_data(session, public_handle)
node.instance_variable_set '@public_url', public_url
node
end
def self.types
@@ -34,9 +34,13 @@
session.request a: 'm', n: handle, t: trash_node_public_handle
end
# Other methods
+
+ def self.public_data session, public_handle
+ session.request a: 'g', g: 1, p: public_handle
+ end
def public_handle
@public_handle ||= session.request(a: 'l', n: handle)
end