Class: Ugigi::Index

Inherits:
Scheme show all
Defined in:
lib/ugigi/scheme.rb

Instance Attribute Summary

Attributes inherited from Scheme

#element

Instance Method Summary collapse

Methods inherited from Scheme

#initialize, #method_missing, #params

Constructor Details

This class inherits a constructor from Ugigi::Scheme

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Ugigi::Scheme

Instance Method Details

#to_sosowa_indexObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/ugigi/scheme.rb', line 18

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"]
  }
end