Class: StarkBank::Utils::SubResource
- Inherits:
-
Object
- Object
- StarkBank::Utils::SubResource
show all
- Defined in:
- lib/utils/sub_resource.rb
Instance Method Summary
collapse
Instance Method Details
#inspect ⇒ Object
16
17
18
|
# File 'lib/utils/sub_resource.rb', line 16
def inspect
"#{class_name}[#{@id}]"
end
|
#to_s ⇒ Object
6
7
8
9
10
11
12
13
14
|
# File 'lib/utils/sub_resource.rb', line 6
def to_s
string_vars = []
instance_variables.each do |key|
value = instance_variable_get(key).to_s.lines.map(&:chomp).join("\n ")
string_vars << "#{key[1..-1]}: #{value}"
end
fields = string_vars.join(",\n ")
"#{class_name}(\n #{fields}\n)"
end
|