Class: Marver::Summary::Story

Inherits:
Object
  • Object
show all
Defined in:
lib/marver/entities/summary/story.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ Story

Returns a new instance of Story.



6
7
8
9
10
11
# File 'lib/marver/entities/summary/story.rb', line 6

def initialize(json)
  @name = json['name']
  @resource_uri = json['resourceURI']
  @type = json['type'] || nil
  @id = json['id'].to_i
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/marver/entities/summary/story.rb', line 4

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/marver/entities/summary/story.rb', line 4

def name
  @name
end

#resource_uriObject (readonly)

Returns the value of attribute resource_uri.



4
5
6
# File 'lib/marver/entities/summary/story.rb', line 4

def resource_uri
  @resource_uri
end

#typeObject (readonly)

Returns the value of attribute type.



4
5
6
# File 'lib/marver/entities/summary/story.rb', line 4

def type
  @type
end

Instance Method Details

#fullObject



13
14
15
16
17
# File 'lib/marver/entities/summary/story.rb', line 13

def full
  response = Marver::API::Response.new(RestClient.get(@resource_uri))
  results = Marver::DataContainer.new(response).results
  Marver::Factory::Story.new(results).build
end