Class: Travis::Client::Link
- Inherits:
-
Object
- Object
- Travis::Client::Link
- Defined in:
- lib/travis/client/link.rb
Instance Attribute Summary collapse
-
#href ⇒ Object
readonly
Returns the value of attribute href.
-
#session ⇒ Object
readonly
Returns the value of attribute session.
Instance Method Summary collapse
- #fetch ⇒ Object
-
#initialize(session, href, payload = {}) ⇒ Link
constructor
A new instance of Link.
- #inspect ⇒ Object
- #limit ⇒ Object
- #offset ⇒ Object
- #to_entity ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(session, href, payload = {}) ⇒ Link
Returns a new instance of Link.
6 7 8 |
# File 'lib/travis/client/link.rb', line 6 def initialize(session, href, payload = {}) @session, @href, @payload = session, href, payload end |
Instance Attribute Details
#href ⇒ Object (readonly)
Returns the value of attribute href.
4 5 6 |
# File 'lib/travis/client/link.rb', line 4 def href @href end |
#session ⇒ Object (readonly)
Returns the value of attribute session.
4 5 6 |
# File 'lib/travis/client/link.rb', line 4 def session @session end |
Instance Method Details
#fetch ⇒ Object
14 15 16 |
# File 'lib/travis/client/link.rb', line 14 def fetch session.fetch(href) end |
#inspect ⇒ Object
30 31 32 |
# File 'lib/travis/client/link.rb', line 30 def inspect "#<%p:%p>" % [ self.class, href.omit(:scheme, :authority).to_s ] end |
#limit ⇒ Object
26 27 28 |
# File 'lib/travis/client/link.rb', line 26 def limit @payload['limit'] end |
#offset ⇒ Object
22 23 24 |
# File 'lib/travis/client/link.rb', line 22 def offset @payload['offset'] end |
#to_entity ⇒ Object
10 11 12 |
# File 'lib/travis/client/link.rb', line 10 def to_entity fetch end |
#to_h ⇒ Object
18 19 20 |
# File 'lib/travis/client/link.rb', line 18 def to_h @payload.dup end |