Class: GSGraph::Poke

Inherits:
Object
  • Object
show all
Includes:
Comparison
Defined in:
lib/gs_graph/poke.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Comparison

#==

Constructor Details

#initialize(attributes = {}) ⇒ Poke

Returns a new instance of Poke.



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/gs_graph/poke.rb', line 7

def initialize(attributes = {})
  if from = attributes[:from]
    @from = User.new from[:id], from
  end
  if to = attributes[:to]
    @to = User.new to[:id], to
  end
  if attributes[:created_time]
    @created_time = Time.parse attributes[:created_time]
  end
end

Instance Attribute Details

#created_timeObject

Returns the value of attribute created_time.



5
6
7
# File 'lib/gs_graph/poke.rb', line 5

def created_time
  @created_time
end

#fromObject

Returns the value of attribute from.



5
6
7
# File 'lib/gs_graph/poke.rb', line 5

def from
  @from
end

#toObject

Returns the value of attribute to.



5
6
7
# File 'lib/gs_graph/poke.rb', line 5

def to
  @to
end