Module: Mingo::Properties

Extended by:
ActiveSupport::Concern
Included in:
Mingo
Defined in:
lib/mingo/properties.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#[](field, &block) ⇒ Object



50
51
52
# File 'lib/mingo/properties.rb', line 50

def [](field, &block)
  super(field.to_s, &block)
end

#[]=(field, value) ⇒ Object



54
55
56
# File 'lib/mingo/properties.rb', line 54

def []=(field, value)
  super(field.to_s, value)
end

#inspectObject



44
45
46
47
48
# File 'lib/mingo/properties.rb', line 44

def inspect
  str = "<##{self.class.to_s}"
  str << self.class.properties.map { |p| " #{p}=#{self.send(p).inspect}" }.join('')
  str << '>'
end

#stringify_keysObject



64
# File 'lib/mingo/properties.rb', line 64

def stringify_keys() stringify_keys!.dup end

#stringify_keys!Object

keys are already strings



63
# File 'lib/mingo/properties.rb', line 63

def stringify_keys!() self end

#to_hashObject



58
59
60
# File 'lib/mingo/properties.rb', line 58

def to_hash
  Hash.new.replace(self)
end