Parent

Methods

Included Modules

Wonderfl::Code

Attributes

thumbnail[R]

(Not documented)

as3[R]

(Not documented)

parent[R]

(Not documented)

modified_date[R]

(Not documented)

compile_ok[R]

(Not documented)

created_date[R]

(Not documented)

forked_count[R]

(Not documented)

license[R]

(Not documented)

swf[R]

(Not documented)

diff[R]

(Not documented)

user_icon[R]

(Not documented)

user_name[R]

(Not documented)

title[R]

(Not documented)

id[R]

(Not documented)

favorite_count[R]

(Not documented)

Public Class Methods

new(payload, code_id = nil) click to toggle source

(Not documented)

# File lib/wonderfl/code.rb, line 7
  def initialize(payload, code_id = nil)
    raise TypeError 'Hash argument expected' unless payload.is_a? Hash
    @code_id = code_id
    @compile_ok = payload['compile_ok'].to_i
    @created_date = parse_time(payload['created_date'])
    @id = payload['id']
    @license = payload['license']
    @parent = payload['parent']
    @swf = payload['swf']
    @thumbnail = payload['thumbnail']
    @title = payload['title']
    if code_id
      @as3 = payload['as3']
      @diff = payload['diff'].to_i
      @favorite_count = payload['favorite_count'].to_i
      @forked_count = payload['forked_count'].to_i
      @modified_date = parse_time(payload['modified_date'])
    end
    if payload['user']
      @user_icon = payload['user']['icon']
      @user_name = payload['user']['name']
    end
  end

Public Instance Methods

to_s() click to toggle source

(Not documented)

# File lib/wonderfl/code.rb, line 31
  def to_s
    if @code_id
      "Wonderfl::Code {\nthumbnail => \#{@thumbnail}\nparent => \#{@parent}\nmodified_date => \#{@modified_date}\ncompile_ok => \#{@compile_ok}\ncreated_date => \#{@created_date}\nforked_count => \#{@forked_count}\nlicense => \#{@license}\nswf => \#{@swf}\ndiff => \#{@diff}\nuser_icon => \#{@user_icon}\nuser_name => \#{@user_name}\ntitle => \#{@title}\nid => \#{@id}\nfavorite_count => \#{@favorite_count}\n}\n"
    end
  end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.