Class: Nelumba::Question

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

Constant Summary

Constants included from Object

Object::USERNAME_REGULAR_EXPRESSION

Instance Attribute Summary collapse

Attributes included from Object

#author, #content, #display_name, #html, #image, #published, #summary, #text, #title, #uid, #updated, #url

Instance Method Summary collapse

Methods included from Object

#mentions, #reply_to, #to_as1, #to_html, #to_json, #to_text

Constructor Details

#initialize(options = {}, &blk) ⇒ Question

Returns a new instance of Question.



7
8
9
# File 'lib/nelumba/question.rb', line 7

def initialize(options = {}, &blk)
  init(options, &blk)
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/nelumba/question.rb', line 5

def options
  @options
end

Instance Method Details

#init(options = {}, &blk) ⇒ Object



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

def init(options = {}, &blk)
  super(options, &blk)

  @options = options[:options] || []
end

#to_hashObject



17
18
19
20
21
# File 'lib/nelumba/question.rb', line 17

def to_hash
  {
    :options => @options.dup
  }.merge(super)
end

#to_json_hashObject



23
24
25
26
27
28
# File 'lib/nelumba/question.rb', line 23

def to_json_hash
  {
    :objectType => "question",
    :options    => @options.dup
  }.merge(super)
end