Class: Logan::Event

Inherits:
Object
  • Object
show all
Includes:
HashConstructed, ResponseHandler
Defined in:
lib/logan/event.rb

Instance Attribute Summary collapse

Attributes included from HashConstructed

#attributes, #json_raw

Instance Method Summary collapse

Methods included from ResponseHandler

#handle_error, #handle_response, #success?

Methods included from HashConstructed

#initialize

Instance Attribute Details

#actionObject

Returns the value of attribute action.



14
15
16
# File 'lib/logan/event.rb', line 14

def action
  @action
end

#created_atObject

Returns the value of attribute created_at.



13
14
15
# File 'lib/logan/event.rb', line 13

def created_at
  @created_at
end

#eventableObject

Returns the value of attribute eventable.



11
12
13
# File 'lib/logan/event.rb', line 11

def eventable
  @eventable
end

#excerptObject

Returns the value of attribute excerpt.



17
18
19
# File 'lib/logan/event.rb', line 17

def excerpt
  @excerpt
end

#idObject

Returns the value of attribute id.



8
9
10
# File 'lib/logan/event.rb', line 8

def id
  @id
end

#raw_excerptObject

Returns the value of attribute raw_excerpt.



16
17
18
# File 'lib/logan/event.rb', line 16

def raw_excerpt
  @raw_excerpt
end

#summaryObject

Returns the value of attribute summary.



9
10
11
# File 'lib/logan/event.rb', line 9

def summary
  @summary
end

#updated_atObject

Returns the value of attribute updated_at.



12
13
14
# File 'lib/logan/event.rb', line 12

def updated_at
  @updated_at
end

#urlObject

Returns the value of attribute url.



10
11
12
# File 'lib/logan/event.rb', line 10

def url
  @url
end

Instance Method Details

#getObject



24
25
26
27
28
29
30
31
32
33
# File 'lib/logan/event.rb', line 24

def get
  begin
    response = Logan::Client.get eventable.url
    o = eval("Logan::#{eventable.type}").new response.parsed_response
    o.json_raw = response.body
    o
  rescue NameError
    return nil
  end
end