Class: Kinu::ResourceBase

Inherits:
Object
  • Object
show all
Defined in:
lib/kinu/resource_base.rb

Direct Known Subclasses

Resource, Sandbox

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, id, options = {}) ⇒ ResourceBase

Returns a new instance of ResourceBase.



8
9
10
# File 'lib/kinu/resource_base.rb', line 8

def initialize(name, id, options = {})
  @name, @id, @options = name, id, options
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



6
7
8
# File 'lib/kinu/resource_base.rb', line 6

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/kinu/resource_base.rb', line 6

def name
  @name
end

Instance Method Details

#path(options) ⇒ Object



19
20
21
22
23
# File 'lib/kinu/resource_base.rb', line 19

def path(options)
  format         = (options.delete(:format) || :jpg)
  geometry       = Geometry.new(options)
  build_path(geometry, format)
end

#uri(options) ⇒ Object



12
13
14
15
16
17
# File 'lib/kinu/resource_base.rb', line 12

def uri(options)
  timestamp      = options.delete(:timestamp)
  format         = (options.delete(:format) || :jpg)
  geometry       = Geometry.new(options)
  build_uri(geometry, format, timestamp)
end