Class: DaFace::Datasift::Interaction
- Inherits:
-
Object
- Object
- DaFace::Datasift::Interaction
- Includes:
- Utilities
- Defined in:
- lib/da_face/datasift/interaction.rb
Instance Attribute Summary collapse
-
#author ⇒ Object
readonly
Returns the value of attribute author.
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#link ⇒ Object
readonly
Returns the value of attribute link.
-
#received_at ⇒ Object
readonly
Returns the value of attribute received_at.
-
#schema ⇒ Object
readonly
Returns the value of attribute schema.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#tag_tree ⇒ Object
readonly
Returns the value of attribute tag_tree.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #allowed_attributes ⇒ Object
-
#initialize(data = {}) ⇒ Interaction
constructor
A new instance of Interaction.
- #normalize_attributes! ⇒ Object
Methods included from Utilities
#parse_json, #parse_timestamp, #parse_uri, #symbolize_keys
Constructor Details
#initialize(data = {}) ⇒ Interaction
10 11 12 13 14 15 16 17 18 |
# File 'lib/da_face/datasift/interaction.rb', line 10 def initialize data={} allowed_attributes.each do |attr| unless data[attr].nil? self.instance_variable_set("@#{attr}".to_sym, data[attr]) end end normalize_attributes! return self end |
Instance Attribute Details
#author ⇒ Object (readonly)
Returns the value of attribute author.
6 7 8 |
# File 'lib/da_face/datasift/interaction.rb', line 6 def end |
#content ⇒ Object (readonly)
Returns the value of attribute content.
6 7 8 |
# File 'lib/da_face/datasift/interaction.rb', line 6 def content @content end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
6 7 8 |
# File 'lib/da_face/datasift/interaction.rb', line 6 def created_at @created_at end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
6 7 8 |
# File 'lib/da_face/datasift/interaction.rb', line 6 def id @id end |
#link ⇒ Object (readonly)
Returns the value of attribute link.
6 7 8 |
# File 'lib/da_face/datasift/interaction.rb', line 6 def link @link end |
#received_at ⇒ Object (readonly)
Returns the value of attribute received_at.
6 7 8 |
# File 'lib/da_face/datasift/interaction.rb', line 6 def received_at @received_at end |
#schema ⇒ Object (readonly)
Returns the value of attribute schema.
6 7 8 |
# File 'lib/da_face/datasift/interaction.rb', line 6 def schema @schema end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
6 7 8 |
# File 'lib/da_face/datasift/interaction.rb', line 6 def source @source end |
#tag_tree ⇒ Object (readonly)
Returns the value of attribute tag_tree.
6 7 8 |
# File 'lib/da_face/datasift/interaction.rb', line 6 def tag_tree @tag_tree end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
6 7 8 |
# File 'lib/da_face/datasift/interaction.rb', line 6 def end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/da_face/datasift/interaction.rb', line 6 def type @type end |
Instance Method Details
#allowed_attributes ⇒ Object
20 21 22 23 24 |
# File 'lib/da_face/datasift/interaction.rb', line 20 def allowed_attributes [:author, :content, :created_at, :id, :link, :received_at, :schema, :source, :type, :tags, :tag_tree] end |
#normalize_attributes! ⇒ Object
26 27 28 29 |
# File 'lib/da_face/datasift/interaction.rb', line 26 def normalize_attributes! @created_at = (@created_at) if @created_at @received_at = (@received_at) if @received_at end |