Class: StackOverflowApi::Question
- Inherits:
-
Struct
- Object
- Struct
- StackOverflowApi::Question
- Defined in:
- lib/chid/stack_overflow_api.rb
Instance Attribute Summary collapse
-
#creation_date ⇒ Object
Returns the value of attribute creation_date.
-
#link ⇒ Object
Returns the value of attribute link.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
Instance Attribute Details
#creation_date ⇒ Object
Returns the value of attribute creation_date
3 4 5 |
# File 'lib/chid/stack_overflow_api.rb', line 3 def creation_date @creation_date end |
#link ⇒ Object
Returns the value of attribute link
3 4 5 |
# File 'lib/chid/stack_overflow_api.rb', line 3 def link @link end |
#title ⇒ Object
Returns the value of attribute title
3 4 5 |
# File 'lib/chid/stack_overflow_api.rb', line 3 def title @title end |
Instance Method Details
#summary ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/chid/stack_overflow_api.rb', line 4 def summary published_at = creation_date.nil? ? 'unkown' : creation_date.strftime("%B %d, %Y") print "\n" print "--- #{title} ---".blue print "\n" print " Posted #{published_at} by ".brown print "\n" print " Link: " print "#{link}".cyan.underline print "\n" end |