Class: Fastly::BelongsToServiceAndVersion

Inherits:
Base
  • Object
show all
Defined in:
lib/fastly/belongs_to_service_and_version.rb

Direct Known Subclasses

Backend, Director, Domain, Healthcheck, Match, Origin, Syslog, VCL

Instance Attribute Summary

Attributes inherited from Base

#fetcher

Instance Method Summary collapse

Methods inherited from Base

#as_hash, #delete!, #initialize, list_path, path, #save!

Constructor Details

This class inherits a constructor from Fastly::Base

Instance Method Details

#serviceObject

Return the Service object this belongs to



4
5
6
# File 'lib/fastly/belongs_to_service_and_version.rb', line 4

def service
  @service ||= fetcher.get(Fastly::Service, service_id)
end

#versionObject

Get the Version object this belongs to



14
15
16
# File 'lib/fastly/belongs_to_service_and_version.rb', line 14

def version
  @version_obj ||= fetcher.get(Fastly::Version, service_id, version_number)
end

#version=(version) ⇒ Object

Set the Version object this belongs to



9
10
11
# File 'lib/fastly/belongs_to_service_and_version.rb', line 9

def version=(version)
  @version = version
end

#version_numberObject

Get the number of the Version this belongs to



19
20
21
# File 'lib/fastly/belongs_to_service_and_version.rb', line 19

def version_number
  @version
end