Class: BOSSMan::BaseValueObject

Inherits:
Object
  • Object
show all
Defined in:
lib/bossman/base_value_object.rb

Direct Known Subclasses

Result, ResultSet

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*args) ⇒ Object



15
16
17
18
# File 'lib/bossman/base_value_object.rb', line 15

def method_missing(*args)
  method = args.first
  instance_variable_get("@#{method}")
end

Instance Method Details

#set_parameter(key, value) ⇒ Object



3
4
5
# File 'lib/bossman/base_value_object.rb', line 3

def set_parameter(key, value)
  instance_variable_set("@#{key}", value) 
end

#to_jsonObject



11
12
13
# File 'lib/bossman/base_value_object.rb', line 11

def to_json
  ActiveSupport::JSON.encode(@response)
end

#to_yamlObject



7
8
9
# File 'lib/bossman/base_value_object.rb', line 7

def to_yaml
  @response.to_yaml
end