Class: GameFaqs::Question

Inherits:
Object
  • Object
show all
Defined in:
lib/gamefaqs/question.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(game, id, options = {}) ⇒ Question

Returns a new instance of Question.



5
6
7
8
9
# File 'lib/gamefaqs/question.rb', line 5

def initialize(game, id, options={})
  @game, @id = game, id
  @homepage = @game.homepage.gsub(/home/, "qna") << "?id=#{@id}"
  @title, @status, @replies, @type = options[:title], options[:status], options[:replies], options[:type]
end

Instance Attribute Details

#gameObject (readonly)

Returns the value of attribute game.



3
4
5
# File 'lib/gamefaqs/question.rb', line 3

def game
  @game
end

#homepageObject (readonly)

Returns the value of attribute homepage.



3
4
5
# File 'lib/gamefaqs/question.rb', line 3

def homepage
  @homepage
end

#idObject (readonly)

Returns the value of attribute id.



3
4
5
# File 'lib/gamefaqs/question.rb', line 3

def id
  @id
end

#repliesObject (readonly)

Returns the value of attribute replies.



3
4
5
# File 'lib/gamefaqs/question.rb', line 3

def replies
  @replies
end

#statusObject (readonly)

Returns the value of attribute status.



3
4
5
# File 'lib/gamefaqs/question.rb', line 3

def status
  @status
end

#titleObject (readonly)

Returns the value of attribute title.



3
4
5
# File 'lib/gamefaqs/question.rb', line 3

def title
  @title
end

#typeObject (readonly)

Returns the value of attribute type.



3
4
5
# File 'lib/gamefaqs/question.rb', line 3

def type
  @type
end

Instance Method Details

#params(list = :all) ⇒ Object



11
12
13
14
15
16
# File 'lib/gamefaqs/question.rb', line 11

def params(list=:all)
  case list
  when :all
    "type=-1"
  end
end