Class: DaFace::Datasift::Link
- Inherits:
-
Object
- Object
- DaFace::Datasift::Link
- Includes:
- Utilities
- Defined in:
- lib/da_face/datasift/link.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#hops ⇒ Object
readonly
Returns the value of attribute hops.
-
#meta ⇒ Object
readonly
Returns the value of attribute meta.
-
#normalized_url ⇒ Object
readonly
Returns the value of attribute normalized_url.
-
#retweet_count ⇒ Object
readonly
Returns the value of attribute retweet_count.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #allowed_attributes ⇒ Object
-
#initialize(data = {}) ⇒ Link
constructor
A new instance of Link.
Methods included from Utilities
#parse_json, #parse_timestamp, #parse_uri, #symbolize_keys
Constructor Details
#initialize(data = {}) ⇒ Link
Returns a new instance of Link.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/da_face/datasift/link.rb', line 9 def initialize data={} allowed_attributes.each do |attr| if data[attr] self.instance_variable_set("@#{attr}".to_sym, data[attr]) end end normalize_attributes! return self end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
6 7 8 |
# File 'lib/da_face/datasift/link.rb', line 6 def code @code end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
6 7 8 |
# File 'lib/da_face/datasift/link.rb', line 6 def created_at @created_at end |
#hops ⇒ Object (readonly)
Returns the value of attribute hops.
6 7 8 |
# File 'lib/da_face/datasift/link.rb', line 6 def hops @hops end |
#meta ⇒ Object (readonly)
Returns the value of attribute meta.
6 7 8 |
# File 'lib/da_face/datasift/link.rb', line 6 def @meta end |
#normalized_url ⇒ Object (readonly)
Returns the value of attribute normalized_url.
6 7 8 |
# File 'lib/da_face/datasift/link.rb', line 6 def normalized_url @normalized_url end |
#retweet_count ⇒ Object (readonly)
Returns the value of attribute retweet_count.
6 7 8 |
# File 'lib/da_face/datasift/link.rb', line 6 def retweet_count @retweet_count end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
6 7 8 |
# File 'lib/da_face/datasift/link.rb', line 6 def title @title end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
6 7 8 |
# File 'lib/da_face/datasift/link.rb', line 6 def url @url end |
Instance Method Details
#allowed_attributes ⇒ Object
20 21 22 23 |
# File 'lib/da_face/datasift/link.rb', line 20 def allowed_attributes [:code, :created_at, :hops, :meta, :normalized_url, :retweet_count, :title, :url] end |