Method: Oceanarium::Size#initialize

Defined in:
lib/oceanarium/resources/size.rb

#initialize(option, api_key, client_id) ⇒ Size

Returns a new instance of Size.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/oceanarium/resources/size.rb', line 5

def initialize(option, api_key, client_id)
  if api_key.nil? || client_id.nil?
    raise 'No API key/client ID!'
  else
    if option.is_a?(Hash)
      @object = option
    end
    if @object.nil?
      self.id = nil
    else
      self.id = @object['id']
      self.name = @object['name']
    end
  end
end