Class: Bio::BaseSpace::BaseSpaceModel

Inherits:
Model
  • Object
show all
Defined in:
lib/basespace/model/basespace_model.rb

Overview

Basic representation of a BaseSpace model.

Instance Attribute Summary collapse

Attributes inherited from Model

#attributes, #swagger_types

Instance Method Summary collapse

Methods inherited from Model

#get_attr, #method_missing, #set_attr, #to_str

Constructor Details

#initializeBaseSpaceModel

Create a new BaseSpaceModel instance.



24
25
26
27
28
29
30
31
32
# File 'lib/basespace/model/basespace_model.rb', line 24

def initialize
  # [TODO] This class is not similar to other modles. Need to check if this port is OK.
  @swagger_types = {
    'Id'  => 'str',
  }
  @attributes = {
    'Id'  => nil,
  }
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Bio::BaseSpace::Model

Instance Attribute Details

#apiObject

Returns the value of attribute api.



21
22
23
# File 'lib/basespace/model/basespace_model.rb', line 21

def api
  @api
end

Instance Method Details

#idObject

Returns the ID of the model.



35
36
37
# File 'lib/basespace/model/basespace_model.rb', line 35

def id
  get_attr('Id')
end

#is_initObject

Returns whether this object has been initialized, which is always the case (i.e., true).



46
47
48
# File 'lib/basespace/model/basespace_model.rb', line 46

def is_init
  return true
end

#set_api(api) ⇒ Object

Set a BaseSpaceAPI object for this BaseSpaceModel.

api

BaseSpaceAPI instance.



53
54
55
# File 'lib/basespace/model/basespace_model.rb', line 53

def set_api(api)
  @api = api
end

#to_sObject

Returns the ID of the model.



40
41
42
43
# File 'lib/basespace/model/basespace_model.rb', line 40

def to_s
  is_init
  return get_attr('Id')
end