class Megam::Rawimages

Public Class Methods

create(params) click to toggle source
# File lib/megam/core/rawimages.rb, line 179
def self.create(params)
    quo = from_hash(params)
    quo.create
end
from_hash(o) click to toggle source
# File lib/megam/core/rawimages.rb, line 148
def self.from_hash(o)
    quo = new(o)
    quo.from_hash(o)
    quo
end
json_create(o) click to toggle source
# File lib/megam/core/rawimages.rb, line 134
def self.json_create(o)
    quo = new({})
    quo.id(o['id']) if o.key?('id')
    quo.org_id(o['org_id']) if o.key?('org_id')
    quo.account_id(o["account_id"]) if o.has_key?("account_id")
    quo.name(o['name']) if o.key?('name')
    quo.repos(o['repos']) if o.key?('repos')
    quo.inputs(o['inputs']) if o.key?('inputs')
    quo.status(o['status']) if o.key?('status')
    quo.created_at(o['created_at']) if o.key?('created_at')
    quo.updated_at(o['updated_at']) if o.key?('updated_at')
    quo
end
list(params) click to toggle source
# File lib/megam/core/rawimages.rb, line 174
def self.list(params)
    quo = self.new(params)
    quo.megam_rest.list_rawimages
end
new(o) click to toggle source
Calls superclass method Megam::RestAdapter::new
# File lib/megam/core/rawimages.rb, line 3
def initialize(o)
    @id = nil
    @account_id = nil
    @name = nil
    @repos = nil
    @status = nil
    @inputs = []
    @created_at = nil
    @updated_at = nil
    @org_id = nil
    super(o)
end
show(params) click to toggle source
# File lib/megam/core/rawimages.rb, line 169
def self.show(params)
    quo = new(params)
    quo.megam_rest.get_one_rawimage(params['id'])
end

Public Instance Methods

account_id(arg=nil) click to toggle source
# File lib/megam/core/rawimages.rb, line 36
def account_id(arg=nil)
    if arg != nil
        @account_id = arg
    else
        @account_id
    end
end
create() click to toggle source
# File lib/megam/core/rawimages.rb, line 184
def create
    megam_rest.post_rawimages(to_hash)
end
created_at(arg = nil) click to toggle source
# File lib/megam/core/rawimages.rb, line 68
def created_at(arg = nil)
 if !arg.nil?
  @created_at = arg
 else
  @created_at
 end
end
error?() click to toggle source
# File lib/megam/core/rawimages.rb, line 92
def error?
    crocked = true if some_msg.key?(:msg_type) && some_msg[:msg_type] == 'error'
end
for_json() click to toggle source
# File lib/megam/core/rawimages.rb, line 118
def for_json
    result = {
        'id' => id,
        'account_id' => account_id,
        'name' => name,
        'org_id' => org_id,
        'repos' => repos,
        'inputs' => inputs,
        'status' => status,
        'created_at' => created_at,
        'updated_at' => updated_at
    }

    result
end
from_hash(o) click to toggle source
# File lib/megam/core/rawimages.rb, line 154
def from_hash(o)
    @id                = o['id'] if o.key?('id')
    @org_id            = o['org_id'] if o.key?('org_id')
    @account_id        = o["account_id"] if o.has_key?("account_id")
    @name              = o['name'] if o.key?('name')
    @region            = o['region'] if o.key?('region')
    @repos             = o['repos'] if o.key?('repos')
    @inputs            = o['inputs'] if o.key?('inputs')
    @status            = o['status'] if o.key?('status')
    @created_at        = o['created_at'] if o.key?('created_at')
    @updated_at        = o['updated_at'] if o.key?('updated_at')
    self
end
id(arg = nil) click to toggle source
# File lib/megam/core/rawimages.rb, line 20
def id(arg = nil)
    if !arg.nil?
        @id = arg
    else
        @id
    end
end
inputs(arg = []) click to toggle source
# File lib/megam/core/rawimages.rb, line 52
def inputs(arg = [])
    if arg != []
        @inputs = arg
    else
        @inputs
    end
end
name(arg = nil) click to toggle source
# File lib/megam/core/rawimages.rb, line 28
def name(arg = nil)
    if !arg.nil?
        @name = arg
    else
        @name
    end
end
org_id(arg = nil) click to toggle source
# File lib/megam/core/rawimages.rb, line 84
def org_id(arg = nil)
 if !arg.nil?
  @org_id = arg
 else
  @org_id
 end
end
rawimages() click to toggle source
# File lib/megam/core/rawimages.rb, line 16
def rawimages
    self
end
repos(arg = nil) click to toggle source
# File lib/megam/core/rawimages.rb, line 44
def repos(arg = nil)
    if !arg.nil?
        @repos = arg
    else
        @repos
    end
end
status(arg = nil) click to toggle source
# File lib/megam/core/rawimages.rb, line 60
def status(arg = nil)
    if !arg.nil?
        @status = arg
    else
        @status
    end
end
to_hash() click to toggle source

Transform the ruby obj -> to a Hash

# File lib/megam/core/rawimages.rb, line 97
def to_hash
    index_hash = {}
    index_hash['json_claz'] = self.class.name
    index_hash['id'] = id
    index_hash['org_id'] = org_id
    index_hash["account_id"] = account_id
    index_hash['name'] = name
    index_hash['repos'] = repos
    index_hash['status'] = status
    index_hash['inputs'] = inputs
    index_hash['created_at'] = created_at
    index_hash['updated_at'] = updated_at
    index_hash
end
to_json(*a) click to toggle source

Serialize this object as a hash: called from JsonCompat. Verify if this called from JsonCompat during testing.

# File lib/megam/core/rawimages.rb, line 114
def to_json(*a)
    for_json.to_json(*a)
end
to_s() click to toggle source

Create the node via the REST API

# File lib/megam/core/rawimages.rb, line 190
def to_s
    Megam::Stuff.styled_hash(to_hash)
end
updated_at(arg = nil) click to toggle source
# File lib/megam/core/rawimages.rb, line 76
def updated_at(arg = nil)
 if !arg.nil?
  @updated_at = arg
 else
  @updated_at
 end
end