Class: MtGox::Base
- Inherits:
-
Object
- Object
- MtGox::Base
- Defined in:
- lib/mtgox/base.rb
Instance Attribute Summary collapse
-
#attrs ⇒ Object
readonly
Returns the value of attribute attrs.
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ Base
constructor
A new instance of Base.
-
#inspect ⇒ Object
skip @attrs.
Constructor Details
#initialize(attrs = {}) ⇒ Base
Returns a new instance of Base.
5 6 7 8 9 10 11 |
# File 'lib/mtgox/base.rb', line 5 def initialize(attrs={}) @attrs = attrs attrs.each {|k, v| send "#{k}=", v rescue NoMethodError } end |
Instance Attribute Details
#attrs ⇒ Object (readonly)
Returns the value of attribute attrs.
3 4 5 |
# File 'lib/mtgox/base.rb', line 3 def attrs @attrs end |
Instance Method Details
#inspect ⇒ Object
skip @attrs
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/mtgox/base.rb', line 14 def inspect ret = "#<#{self.class}:0x#{object_id}" vars = instance_variables.each.with_object([]) do |n, memo| next if n == :@attrs memo << "#{n}=#{instance_variable_get(n).inspect}" end ret << " #{vars.join(", ")}" unless vars.empty? ret << ">" ret end |