Class: Relyze::FileModel::Information

Inherits:
Object
  • Object
show all
Defined in:
C:/Program Files/Relyze/lib/relyze/core/file_model.rb

Overview

The information class describes a line of information as displayed in the Overview of a model in the GUI.

Examples:

Add a new Information object to the model.

def run
    cm.synchronize_write do
        cm.add_information(
            Relyze::FileModel::Information.new( {
                :group => :general,
                :title => 'Testing',
                :data  => 'Visit us online!',
                :view  => :internet,
                :url   => 'https://www.relyze.com/'
            } )
        )
    end
    if( @relyze.gui? and @relyze.active_tab == cm )
        @relyze.update_gui
    end
end

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ Information

Returns a new instance of Information

Parameters:

  • params (Hash) (defaults to: {})

    The parameters to initialize this information object with.

Options Hash (params):



58
59
60
61
62
63
64
65
# File 'C:/Program Files/Relyze/lib/relyze/core/file_model.rb', line 58

def initialize( params={} )
    @group  = params[:group]  || :general
    @title  = params[:title]  || ''
    @data   = params[:data]   || ''
    @view   = params[:view]   || :unknown
    @offset = params[:offset] || -1
    @url    = params[:url]    || ''
end

Instance Attribute Details

#dataObject

A String for this information data.



40
41
42
# File 'C:/Program Files/Relyze/lib/relyze/core/file_model.rb', line 40

def data
  @data
end

#groupObject

A Symbol for group this Information belongs to, either :file, :hash, :format, :security, :analysis, :general or :plugin



34
35
36
# File 'C:/Program Files/Relyze/lib/relyze/core/file_model.rb', line 34

def group
  @group
end

#offsetObject

If the view is either :overview, :structure or :code, then the offset describes the file offset to go to.



46
47
48
# File 'C:/Program Files/Relyze/lib/relyze/core/file_model.rb', line 46

def offset
  @offset
end

#titleObject

A String for the title of this information.



37
38
39
# File 'C:/Program Files/Relyze/lib/relyze/core/file_model.rb', line 37

def title
  @title
end

#urlObject

If the view is :internet, then the URL describes the location to visit in the users browser.



49
50
51
# File 'C:/Program Files/Relyze/lib/relyze/core/file_model.rb', line 49

def url
  @url
end

#viewObject

A Symbol for the view that will be changed to if this information is double clicked in the GUI, either :overview, :structure, :code or :internet.



43
44
45
# File 'C:/Program Files/Relyze/lib/relyze/core/file_model.rb', line 43

def view
  @view
end

Instance Method Details

#to_sString

Returns this information #data.

Returns:

  • (String)

    Returns this information #data.



68
69
70
# File 'C:/Program Files/Relyze/lib/relyze/core/file_model.rb', line 68

def to_s
    return @data
end
/a> 0.9.20 (ruby-2.6.5).