flickr-objects 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. data/README.md +55 -85
  2. data/lib/flickr/api/api_methods/flickr.rb +0 -1
  3. data/lib/flickr/api/api_methods/person.rb +3 -3
  4. data/lib/flickr/api/api_methods/photo.rb +12 -1
  5. data/lib/flickr/api/api_methods/set.rb +6 -5
  6. data/lib/flickr/api/flickr.rb +9 -9
  7. data/lib/flickr/api/person.rb +13 -29
  8. data/lib/flickr/api/photo.rb +51 -4
  9. data/lib/flickr/api/set.rb +20 -25
  10. data/lib/flickr/api/upload_ticket.rb +4 -2
  11. data/lib/flickr/api.rb +0 -2
  12. data/lib/flickr/api_caller.rb +5 -11
  13. data/lib/flickr/client/upload_client.rb +4 -16
  14. data/lib/flickr/client.rb +1 -1
  15. data/lib/flickr/configuration.rb +2 -0
  16. data/lib/flickr/errors.rb +19 -0
  17. data/lib/flickr/middleware.rb +63 -0
  18. data/lib/flickr/oauth.rb +109 -0
  19. data/lib/flickr/object/attribute/finder.rb +2 -2
  20. data/lib/flickr/object/attribute.rb +8 -8
  21. data/lib/flickr/object.rb +13 -2
  22. data/lib/flickr/objects/attribute_values/{collection.rb → list.rb} +1 -1
  23. data/lib/flickr/objects/attribute_values/photo.rb +81 -16
  24. data/lib/flickr/objects/attribute_values/set.rb +1 -5
  25. data/lib/flickr/objects/attribute_values/upload_ticket.rb +3 -5
  26. data/lib/flickr/objects/list.rb +86 -0
  27. data/lib/flickr/objects/location.rb +2 -0
  28. data/lib/flickr/objects/note.rb +3 -1
  29. data/lib/flickr/objects/permissions.rb +2 -0
  30. data/lib/flickr/objects/person.rb +8 -5
  31. data/lib/flickr/objects/photo.rb +98 -30
  32. data/lib/flickr/objects/set.rb +4 -5
  33. data/lib/flickr/objects/tag.rb +2 -0
  34. data/lib/flickr/objects/upload_ticket.rb +8 -6
  35. data/lib/flickr/objects/visibility.rb +2 -0
  36. data/lib/flickr/objects.rb +2 -7
  37. data/lib/flickr/version.rb +1 -1
  38. data/lib/flickr.rb +5 -0
  39. metadata +60 -32
  40. data/lib/flickr/api/api_methods/collection.rb +0 -4
  41. data/lib/flickr/api/api_methods/location.rb +0 -4
  42. data/lib/flickr/api/api_methods/media.rb +0 -14
  43. data/lib/flickr/api/api_methods/note.rb +0 -4
  44. data/lib/flickr/api/api_methods/permissions.rb +0 -4
  45. data/lib/flickr/api/api_methods/tag.rb +0 -4
  46. data/lib/flickr/api/api_methods/video.rb +0 -4
  47. data/lib/flickr/api/api_methods/visibility.rb +0 -4
  48. data/lib/flickr/api/collection.rb +0 -4
  49. data/lib/flickr/api/location.rb +0 -4
  50. data/lib/flickr/api/media.rb +0 -52
  51. data/lib/flickr/api/note.rb +0 -4
  52. data/lib/flickr/api/permissions.rb +0 -4
  53. data/lib/flickr/api/tag.rb +0 -4
  54. data/lib/flickr/api/video.rb +0 -11
  55. data/lib/flickr/api/visibility.rb +0 -4
  56. data/lib/flickr/client/middleware/retry.rb +0 -29
  57. data/lib/flickr/client/middleware.rb +0 -42
  58. data/lib/flickr/helpers/inheritable_attr_accessor.rb +0 -18
  59. data/lib/flickr/objects/attribute_values/media.rb +0 -70
  60. data/lib/flickr/objects/attribute_values/video.rb +0 -27
  61. data/lib/flickr/objects/collection.rb +0 -56
  62. data/lib/flickr/objects/media.rb +0 -72
  63. data/lib/flickr/objects/video.rb +0 -21
data/lib/flickr/client.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require "faraday"
2
2
  require "faraday_middleware"
3
- require "flickr/client/middleware"
3
+ require "flickr/middleware"
4
4
 
5
5
  class Flickr
6
6
  class Client < Faraday::Connection
@@ -12,6 +12,8 @@ class Flickr
12
12
  attr_accessor :secure
13
13
  attr_accessor :proxy
14
14
 
15
+ attr_accessor :pagination
16
+
15
17
  def fetch(*attributes)
16
18
  attributes.map { |attribute| send(attribute) }
17
19
  end
@@ -0,0 +1,19 @@
1
+ class Flickr
2
+ class Error < StandardError
3
+ end
4
+
5
+ class OAuthError < Error
6
+ end
7
+
8
+ class ApiError < Error
9
+ attr_reader :code
10
+
11
+ def initialize(message, code = nil)
12
+ super(message)
13
+ @code = code.to_i
14
+ end
15
+ end
16
+
17
+ class TimeoutError < Error
18
+ end
19
+ end
@@ -0,0 +1,63 @@
1
+ require "cgi"
2
+ require "faraday"
3
+ require "flickr/errors"
4
+ require "faraday_middleware/response_middleware"
5
+
6
+ class Flickr
7
+ module Middleware
8
+ class CheckStatus < Faraday::Response::Middleware
9
+ def on_complete(env)
10
+ env[:body] = env[:body]["rsp"] || env[:body]
11
+
12
+ if env[:body]["stat"] != "ok"
13
+ message = env[:body]["message"] || env[:body]["err"]["msg"]
14
+ code = env[:body]["code"] || env[:body]["err"]["code"]
15
+ raise ApiError.new(message, code)
16
+ end
17
+ end
18
+ end
19
+
20
+ class CheckOAuth < Faraday::Response::Middleware
21
+ def on_complete(env)
22
+ if env[:status] != 200
23
+ message = CGI.parse(env[:body])["oauth_problem"].first
24
+ pretty_message = message.gsub('_', ' ').capitalize
25
+ raise OAuthError, pretty_message
26
+ end
27
+ end
28
+ end
29
+
30
+ class ParseOAuth < FaradayMiddleware::ResponseMiddleware
31
+ define_parser do |body|
32
+ CGI.parse(body).inject({}) do |hash, (key, value)|
33
+ hash.update(key.to_sym => value.first)
34
+ end
35
+ end
36
+ end
37
+
38
+ # A copy from Faraday (credits to @mislav)
39
+ class Retry < Faraday::Middleware
40
+ def initialize(app, options = {})
41
+ super(app)
42
+ @retries, options = options, {} if options.is_a? Integer
43
+ @retries ||= options.fetch(:max, 2).to_i
44
+ @sleep = options.fetch(:interval, 0).to_f
45
+ @errmatch = options.fetch(:exceptions) { [Errno::ETIMEDOUT, 'Timeout::Error', Faraday::Error::TimeoutError] }
46
+ end
47
+
48
+ def call(env)
49
+ retries = @retries
50
+ begin
51
+ @app.call(env)
52
+ rescue *@errmatch => error
53
+ if retries > 0
54
+ retries -= 1
55
+ sleep @sleep if @sleep > 0
56
+ retry
57
+ end
58
+ raise Flickr::TimeoutError, error.message
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,109 @@
1
+ require "faraday"
2
+ require "faraday_middleware"
3
+ require "flickr/middleware"
4
+
5
+ class Flickr
6
+ module OAuth
7
+ URL = "http://www.flickr.com/services/oauth".freeze
8
+ NO_CALLBACK = 'oob'.freeze
9
+ DEFAULTS = Client::DEFAULTS
10
+
11
+ extend self
12
+
13
+ def get_request_token(options = {})
14
+ response = connection.get "request_token" do |req|
15
+ req.params[:oauth_callback] = options[:callback_url] || NO_CALLBACK
16
+ end
17
+
18
+ RequestToken.new(response.body)
19
+ end
20
+
21
+ def get_access_token(verifier, request_token)
22
+ response = connection(request_token.to_a).get "access_token" do |req|
23
+ req.params[:oauth_verifier] = verifier
24
+ end
25
+
26
+ AccessToken.new(response.body)
27
+ end
28
+
29
+ class Token
30
+ attr_reader :token, :secret
31
+
32
+ def initialize(*args)
33
+ if args.first.is_a?(Hash)
34
+ @token = args.first[:oauth_token]
35
+ @secret = args.first[:oauth_token_secret]
36
+ else
37
+ @token = args.first
38
+ @secret = args.last
39
+ end
40
+ end
41
+
42
+ def to_a
43
+ [token, secret]
44
+ end
45
+ end
46
+
47
+ class RequestToken < Token
48
+ def authorize_url(params = {})
49
+ require 'uri'
50
+ url = URI.parse(URL)
51
+ url.path += '/authorize'
52
+ query_params = {oauth_token: token}.merge(params)
53
+ url.query = query_params.map { |k,v| "#{k}=#{v}" }.join('&')
54
+ url.to_s
55
+ end
56
+
57
+ def get_access_token(verifier)
58
+ OAuth.get_access_token(verifier, self)
59
+ end
60
+ end
61
+
62
+ class AccessToken < Token
63
+ attr_reader :user_info
64
+
65
+ def initialize(info)
66
+ super
67
+ @user_info = info.tap do |info|
68
+ info.delete(:oauth_token)
69
+ info.delete(:oauth_token_secret)
70
+ end
71
+ end
72
+ end
73
+
74
+ private
75
+
76
+ def connection(request_token = nil)
77
+ api_key, shared_secret = Flickr.configuration.fetch(:api_key, :shared_secret)
78
+
79
+ open_timeout = Flickr.configuration.open_timeout || DEFAULTS[:open_timeout]
80
+ timeout = Flickr.configuration.timeout || DEFAULTS[:timeout]
81
+
82
+ url = URL
83
+ proxy = Flickr.configuration.proxy
84
+
85
+ params = {
86
+ url: url,
87
+ request: {
88
+ open_timeout: open_timeout,
89
+ timeout: timeout
90
+ },
91
+ proxy: proxy
92
+ }
93
+
94
+ Faraday.new(params) do |builder|
95
+ builder.use Middleware::Retry
96
+ builder.use FaradayMiddleware::OAuth,
97
+ consumer_key: api_key,
98
+ consumer_secret: shared_secret,
99
+ token: Array(request_token).first,
100
+ token_secret: Array(request_token).last
101
+
102
+ builder.use Middleware::ParseOAuth
103
+ builder.use Middleware::CheckOAuth
104
+
105
+ builder.adapter :net_http
106
+ end
107
+ end
108
+ end
109
+ end
@@ -5,12 +5,12 @@ class Flickr
5
5
  @instance = instance
6
6
  end
7
7
 
8
- def find(attribute, *args)
8
+ def find(attribute)
9
9
  attribute_values = @instance.class.attribute_values[attribute] || []
10
10
  attribute_values << ->{ @hash.fetch(attribute.to_s) }
11
11
 
12
12
  try_each(attribute_values) do |attribute_value|
13
- result = @instance.instance_exec(*args, &attribute_value)
13
+ result = @instance.instance_exec(&attribute_value)
14
14
  return result unless result.nil?
15
15
  end
16
16
 
@@ -1,5 +1,3 @@
1
- require "flickr/helpers/inheritable_attr_accessor"
2
-
3
1
  class Flickr
4
2
  class Object
5
3
  module Attribute
@@ -13,11 +11,9 @@ class Flickr
13
11
 
14
12
  def attribute(name, type = ::Object, options = {})
15
13
  attributes << name
16
- children.each { |child| child.attributes << name } if respond_to?(:children)
17
14
 
18
- define_method(name) do |*args|
19
- value = attribute_finder.find(name, *args)
20
- attribute_converter.convert(value, type)
15
+ define_method(name) do
16
+ retrieve_value(name, type)
21
17
  end
22
18
 
23
19
  Array(options[:aliases]).each do |alias_name|
@@ -33,10 +29,14 @@ class Flickr
33
29
  def attribute_converter
34
30
  Converter.new(self)
35
31
  end
32
+
33
+ def retrieve_value(name, type)
34
+ value = attribute_finder.find(name)
35
+ attribute_converter.convert(value, type)
36
+ end
36
37
  end
37
38
 
38
- extend InheritableAttrAccessor
39
- inheritable_attr_accessor :attribute_values
39
+ attr_accessor :attribute_values
40
40
  end
41
41
  end
42
42
  end
data/lib/flickr/object.rb CHANGED
@@ -11,14 +11,17 @@ class Flickr
11
11
  child.send(:extend, Attribute)
12
12
  child.send(:include, ApiCaller)
13
13
 
14
- children << child
15
- Object.children << child if self != Object
14
+ Object.children << child
16
15
  end
17
16
 
18
17
  def self.find(id)
19
18
  new({"id" => id}, client)
20
19
  end
21
20
 
21
+ def self.new_list(hashes, client, list_hash)
22
+ List.new(hashes.map { |hash| new(hash, client) }, list_hash)
23
+ end
24
+
22
25
  def inspect
23
26
  attribute_values = {}
24
27
  self.class.attributes.each do |name|
@@ -29,6 +32,14 @@ class Flickr
29
32
  "#<#{class_name}:#{id} #{attribute_values.map { |k, v| "#{k}=#{v.inspect}" }.join(" ")}>"
30
33
  end
31
34
 
35
+ def ==(other)
36
+ if (self.respond_to?(:id) && self.id) && (other.respond_to?(:id) && other.id)
37
+ id == other.id
38
+ else
39
+ super
40
+ end
41
+ end
42
+
32
43
  protected
33
44
 
34
45
  def initialize(hash, client)
@@ -1,5 +1,5 @@
1
1
  class Flickr
2
- class Collection < Object
2
+ class List
3
3
  self.attribute_values = {
4
4
  current_page: [->{ @hash["page"] }],
5
5
  per_page: [->{ @hash["per_page"] }, ->{ @hash["perpage"] }],
@@ -1,19 +1,84 @@
1
1
  class Flickr
2
- class Photo < Media
3
- self.attribute_values = attribute_values.merge(
4
- rotation: [->{ @hash["rotation"] }],
5
- source_url: [
6
- ->{ @hash["url_#{SIZES[size]}"] },
7
- ->{ @hash["size"].find { |hash| hash["label"] == OTHER_SIZES[size] }["source"] }
8
- ],
9
- height: [
10
- ->{ @hash["height_#{SIZES[size]}"] },
11
- ->{ @hash["size"].find { |hash| hash["label"] == OTHER_SIZES[size] }["height"] }
12
- ],
13
- width: [
14
- ->{ @hash["width_#{SIZES[size]}"] },
15
- ->{ @hash["size"].find { |hash| hash["label"] == OTHER_SIZES[size] }["width"] }
16
- ],
17
- )
2
+ class Photo < Object
3
+ self.attribute_values = {
4
+ uploaded_at: [->{ @hash["dateuploaded"] }, ->{ @hash["dateupload"] }],
5
+ favorite?: [->{ @hash["isfavorite"] }],
6
+ posted_at: [->{ @hash["dates"]["posted"] }],
7
+ taken_at: [->{ @hash["dates"]["taken"] }, ->{ @hash["datetaken"] }],
8
+ taken_at_granularity: [->{ @hash["dates"]["takengranularity"] }, ->{ @hash["datetakengranularity"] }],
9
+ updated_at: [->{ @hash["dates"]["lastupdate"] }, ->{ @hash["lastupdate"] }],
10
+ views_count: [->{ @hash["views"] }],
11
+ public_editability: [->{ @hash["publiceditability"] }],
12
+ comments_count: [->{ @hash["comments"]["_content"] }],
13
+ has_people?: [->{ @hash["people"]["haspeople"] }],
14
+ notes: [->{ @hash["notes"]["note"] }],
15
+ tags: [
16
+ ->{ @hash["tags"]["tag"].map { |h| h.merge("photo_id" => @hash["id"]) } },
17
+ ->{
18
+ [
19
+ *@hash["tags"].split(" ").map {|content| {"_content" => content, "machine_tag" => 0} },
20
+ *@hash["machine_tags"].split(" ").map {|content| {"_content" => content, "machine_tag" => 1} }
21
+ ]
22
+ }
23
+ ],
24
+ visibility: [->{ @hash["visibility"] }, ->{ @hash.slice("ispublic", "isfriend", "isfamily") if @hash["ispublic"] }],
25
+ title: [->{ @hash["title"]["_content"] }],
26
+ description: [->{ @hash["description"]["_content"] }],
27
+ owner: [
28
+ ->{
29
+ if @hash["owner"].is_a?(String)
30
+ {
31
+ "id" => @hash["owner"],
32
+ "username" => @hash["ownername"],
33
+ "iconserver" => @hash["iconserver"],
34
+ "iconfarm" => @hash["iconfarm"],
35
+ }
36
+ end
37
+ }
38
+ ],
39
+ path_alias: [->{ @hash["pathalias"] }],
40
+ location_visibility: [
41
+ ->{ @hash["geoperms"] },
42
+ ->{
43
+ {
44
+ "isfamily" => @hash.fetch("geo_is_family"),
45
+ "isfriend" => @hash.fetch("geo_is_friend"),
46
+ "iscontact" => @hash.fetch("geo_is_contact"),
47
+ "ispublic" => @hash.fetch("geo_is_public")
48
+ }
49
+ }
50
+ ],
51
+ location: [->{ @hash.slice("latitude", "longitude", "accuracy", "context", "place_id", "woeid") if @hash["latitude"] }],
52
+ largest_size: [->{ SIZES.key(SIZES.values.reverse.find { |abbr| @hash["url_#{abbr}"] }) }],
53
+ available_sizes: [->{ SIZES.select { |_, abbr| @hash["url_#{abbr}"] }.keys }],
54
+ rotation: [->{ @hash["rotation"] }],
55
+ source_url: [
56
+ ->{ @hash["url_#{SIZES[size]}"] },
57
+ ->{ @hash["size"].find { |hash| hash["label"] == OTHER_SIZES[size] }["source"] }
58
+ ],
59
+ height: [
60
+ ->{ @hash["height_#{SIZES[size]}"] },
61
+ ->{ @hash["size"].find { |hash| hash["label"] == OTHER_SIZES[size] }["height"] }
62
+ ],
63
+ width: [
64
+ ->{ @hash["width_#{SIZES[size]}"] },
65
+ ->{ @hash["size"].find { |hash| hash["label"] == OTHER_SIZES[size] }["width"] }
66
+ ],
67
+ }
68
+
69
+ OTHER_SIZES = {
70
+ "Square 75" => "Square",
71
+ "Thumbnail" => "Thumbnail",
72
+ "Square 150" => "Large Square",
73
+ "Small 240" => "Small",
74
+ "Small 320" => "Small 320",
75
+ "Medium 500" => "Medium",
76
+ "Medium 640" => "Medium 640",
77
+ "Medium 800" => "Medium 800",
78
+ "Large 1024" => "Large",
79
+ "Large 1600" => "Large 1600",
80
+ "Large 2048" => "Large 2048",
81
+ "Original" => "Original"
82
+ }
18
83
  end
19
84
  end
@@ -3,19 +3,15 @@ class Flickr
3
3
  self.attribute_values = {
4
4
  owner: [-> { {"id" => @hash.fetch("owner"), "username" => @hash["username"]} }],
5
5
  url: [-> { "http://www.flickr.com/photos/#{owner.id}/sets/#{id}/" }],
6
- media_count: [-> { @hash["photos"] }],
6
+ photos_count: [-> { @hash["photos"] }, -> { @hash["count_photos"] }],
7
7
  views_count: [-> { @hash["count_views"] }],
8
8
  comments_count: [-> { @hash["count_comments"] }],
9
- photos_count: [-> { @hash["count_photos"] }, -> { @hash["photos"] }],
10
- videos_count: [-> { @hash["count_videos"] }, -> { @hash["videos"] }],
11
9
  title: [-> { @hash["title"]["_content"] }],
12
10
  description: [-> { @hash["description"]["_content"] }],
13
11
  permissions: [-> { @hash.slice("can_comment") }],
14
12
  created_at: [-> { @hash["date_create"] }],
15
13
  updated_at: [-> { @hash["date_update"] }],
16
- primary_media: [-> { {"id" => @hash.fetch("primary")} }],
17
14
  primary_photo: [-> { {"id" => @hash.fetch("primary")} }],
18
- primary_video: [-> { {"id" => @hash.fetch("primary")} }],
19
15
  }
20
16
  end
21
17
  end
@@ -1,11 +1,9 @@
1
1
  class Flickr
2
2
  class UploadTicket < Object
3
3
  self.attribute_values = {
4
- status: [->{ @hash["complete"] }],
5
- invalid?: [->{ @hash["invalid"] || 0 }],
6
- media: [->{ {"id" => @hash.fetch("photoid")} }],
7
- photo: [->{ {"id" => @hash.fetch("photoid")} }],
8
- video: [->{ {"id" => @hash.fetch("photoid")} }],
4
+ status: [->{ @hash["complete"] }],
5
+ invalid: [->{ @hash["invalid"] || 0}],
6
+ photo: [->{ {"id" => @hash.fetch("photoid")} }],
9
7
  }
10
8
  end
11
9
  end
@@ -0,0 +1,86 @@
1
+ class Flickr
2
+ case Flickr.configuration.pagination
3
+ when nil
4
+
5
+ class List < Array
6
+ extend Flickr::Object::Attribute
7
+
8
+ attribute :current_page, Integer
9
+ attribute :per_page, Integer
10
+ attribute :total_pages, Integer
11
+ attribute :total_entries, Integer
12
+
13
+ def initialize(objects, hash)
14
+ @hash = hash
15
+ super(objects)
16
+ end
17
+ end
18
+
19
+ when :will_paginate
20
+
21
+ require "will_paginate/collection"
22
+
23
+ class List < WillPaginate::Collection
24
+ extend Flickr::Object::Attribute
25
+
26
+ def initialize(objects, hash)
27
+ @hash = hash
28
+ super(
29
+ retrieve_value(:current_page, Integer),
30
+ retrieve_value(:per_page, Integer),
31
+ retrieve_value(:total_entries, Integer)
32
+ )
33
+ replace(objects)
34
+ end
35
+ end
36
+
37
+ when :kaminari
38
+
39
+ require "kaminari"
40
+ require "kaminari/models/array_extension"
41
+
42
+ class List < Kaminari::PaginatableArray
43
+ extend Flickr::Object::Attribute
44
+
45
+ def initialize(objects, hash)
46
+ @hash = hash
47
+ super(objects,
48
+ offset: retrieve_value(:current_page, Integer),
49
+ limit: retrieve_value(:per_page, Integer),
50
+ total_count: retrieve_value(:total_entries, Integer)
51
+ )
52
+ end
53
+ end
54
+
55
+ else
56
+ raise Error, "supported paginations are :will_paginate or :kaminari (you put \":#{Flickr.configuration.pagination}\")"
57
+ end
58
+ end
59
+
60
+ require_relative "attribute_values/list"
61
+
62
+ class Flickr
63
+ class List
64
+ def find(id = nil)
65
+ if block_given?
66
+ super
67
+ else
68
+ if id.is_a?(Array)
69
+ ids = id.map(&:to_s)
70
+ select { |object| ids.include?(object.id) }
71
+ else
72
+ super() { |object| object.id == id.to_s }
73
+ end
74
+ end
75
+ end
76
+
77
+ def method_missing(name, *args, &block)
78
+ if name.to_s =~ /find_by_\w+/
79
+ attribute_name = name[/(?<=find_by_)\w+/]
80
+ find { |object| object.send(attribute_name) == args.first }
81
+ else
82
+ super
83
+ end
84
+ end
85
+ end
86
+ end
@@ -1,3 +1,5 @@
1
+ require_relative "attribute_values/location"
2
+
1
3
  class Flickr
2
4
  class Location < Object
3
5
 
@@ -1,9 +1,11 @@
1
+ require_relative "attribute_values/note"
2
+
1
3
  class Flickr
2
4
  class Note < Object
3
5
 
4
6
  attribute :id, String
5
7
  attribute :author, Person
6
- attribute :coordinates, Array(Integer)
8
+ attribute :coordinates, Array[Integer]
7
9
  attribute :width, Integer
8
10
  attribute :height, Integer
9
11
  attribute :content, String
@@ -1,3 +1,5 @@
1
+ require_relative "attribute_values/permissions"
2
+
1
3
  class Flickr
2
4
  class Permissions < Object
3
5
 
@@ -1,3 +1,6 @@
1
+ require_relative "attribute_values/person"
2
+ require "flickr/api/person"
3
+
1
4
  class Flickr
2
5
  class Person < Object
3
6
 
@@ -13,15 +16,15 @@ class Flickr
13
16
  attribute :icon_server, Integer
14
17
  attribute :icon_farm, Integer
15
18
 
16
- attribute :photos_url, String, aliases: [:videos_url, :media_url]
19
+ attribute :photos_url, String
17
20
  attribute :profile_url, String
18
21
  attribute :mobile_url, String
19
22
 
20
- attribute :first_photo_taken, Time, aliases: [:first_video_taken, :first_media_taken]
21
- attribute :first_photo_uploaded, Time, aliases: [:first_video_uploaded, :first_media_uploaded]
23
+ attribute :first_photo_taken, Time
24
+ attribute :first_photo_uploaded, Time
22
25
 
23
- attribute :photos_count, Integer, aliases: [:videos_count, :media_count]
24
- attribute :photo_views_count, Integer, aliases: [:video_views_count, :media_views_count]
26
+ attribute :photos_count, Integer
27
+ attribute :photo_views_count, Integer
25
28
 
26
29
  attribute :path_alias, String
27
30