lib/ugigi/scheme.rb in ugigi-0.3.1 vs lib/ugigi/scheme.rb in ugigi-0.3.2
- old
+ new
@@ -1,11 +1,11 @@
module Ugigi
class Scheme
attr_accessor :element
def method_missing(action, *args)
- return @element[action.to_s] || @element[action.to_sym] rescue nil
+ return @element[action.to_s] rescue nil
end
def params() @element.keys.map{|k|k.to_sym} ; end
alias_method :available_methods, :params
end
@@ -17,22 +17,22 @@
def to_sosowa_index
log = @element["link"].scan(/log=(\d+?)/)[0][0].to_i
key = @element["link"].scan(/key=(\d+?)/)[0][0].to_i
index = {
- :log => log,
- :key => key,
- :title => @element["title"],
- :author => @element["author"],
- :created_at => @element["posted_at"],
- :updated_at => @element["updated_at"],
- :review_count => nil,
- :comment_count => @element["comment"],
- :point => @element["point"],
- :tags => @element["tags"],
- :rate => @element["eval"],
- :size => @element["size"],
- :url => @element["link"]
+ "log" => log,
+ "key" => key,
+ "title" => @element["title"],
+ "author" => @element["author"],
+ "created_at" => @element["posted_at"],
+ "updated_at" => @element["updated_at"],
+ "review_count" => nil,
+ "comment_count" => @element["comment"],
+ "point" => @element["point"],
+ "tags" => @element["tags"],
+ "rate" => @element["eval"],
+ "size" => @element["size"],
+ "url" => @element["link"]
}
end
end
end
\ No newline at end of file