Class: FSR::Model::Agent

Inherits:
OpenStruct show all
Defined in:
lib/fsr/model/agent.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from OpenStruct

#to_hash, #to_json

Constructor Details

#initialize(fields, *data) ⇒ Agent

Returns a new instance of Agent.



7
8
9
10
# File 'lib/fsr/model/agent.rb', line 7

def initialize(fields, *data)
  super(Hash[fields.zip(data)])
  @extension, @full_name = name.split("-", 2)
end

Instance Attribute Details

#extensionObject

Returns the value of attribute extension.



5
6
7
# File 'lib/fsr/model/agent.rb', line 5

def extension
  @extension
end

#full_nameObject

Returns the value of attribute full_name.



5
6
7
# File 'lib/fsr/model/agent.rb', line 5

def full_name
  @full_name
end

Instance Method Details

#fieldsObject

Raises:

  • (NotImplementedError)


12
13
14
# File 'lib/fsr/model/agent.rb', line 12

def fields
  raise NotImplementedError, "This class is now an OpenStruct"
end