매우 직선이지만 앞으로 답을 찾을 수 없습니다.루비에서 해시 및/또는 배열의 제목이나 이름을 얻는 방법은 무엇입니까
page:
page_url: http://www.stackoverflow.com/
created_at: "2011-08-10T11:00:19Z"
website_id: 1
updated_at: "2011-08-10T11:00:19Z"
id: 1
Hash
내가이의 .class를 사용하여 및 제목 페이지입니다 해시가 덤프 알고 :
내가 같은 YAML에 버려진 물체를 말한다. 평상시대로 키 중 하나를 참조 할 수 있습니다. 어떻게 해시의 제목이나 이름을 얻을 수 있습니까? 배열에 대해서도 똑같은가? object.methods의결과
해시
presence
zip
find_index
invert
silence_stderr
enum_slice
deep_merge
load
gem
require_dependency
extract!
minmax
encode64
rehash
debugger
methods
send
assert_valid_keys
replace
values_at
empty?
group_by
diff
taint
instance_variable_defined?
shift
stringify_keys
take
to_param
to_yaml
key?
find_all
update
silence_stream
as_json
singleton_class
keys
require
many?
min_by
each_cons
entries
to_hash
singleton_methods
instance_eval
require_library_or_gem
to_json
first
require_or_load
nil?
b64encode
take_while
select
deep_merge!
with_options
extractable_options?
exclude?
max_by
enum_cons
deep_symbolize_keys
protected_methods
instance_exec
display
sort
store
returning
tainted?
method
delete_if
include?
stringify_keys!
untaint
instance_of?
merge!
symbolize_keys
drop
equal?
suppress
reject
merge
minmax_by
sum
to_set
yaml_initialize
hash
private_methods
all?
sort_by
default_proc
to_query
silence_warnings
`
require_association
kind_of?
freeze
acts_like?
drop_while
eql?
indexes
html_safe?
collect
id
reverse_merge
slice
reject!
grep
each_value
instance_values
with_warnings
any?
public_methods
breakpoint
symbolize_keys!
object_id
is_a?
has_key?
cycle
indices
to_options
except!
map
member?
tap
type
fetch
with_indifferent_access
each_with_index
decode64
count
each_key
instance_variable_names
enable_warnings
one?
instance_variables
try
__id__
frozen?
suppress_warnings
clear
load_dependency
to_enum
to_yaml_properties
has_value?
to_a
respond_to?
each_with_object
each
taguri
inject
slice!
class
encode_json
reverse_update
length
enum_with_index
instance_variable_get
each_pair
copy_instance_variables_from
none?
taguri=
find
==
__send__
===
enum_for
min
to_options!
extend
value?
to_s
default
index_by
index
size
reduce
blank?
unloadable
to_yaml_style
default=
clone
reverse_each
decode_b
=~
instance_variable_set
detect
values
to_xml
max
each_slice
inspect
[]
class_eval
present?
duplicable?
reverse_merge!
except
partition
delete
[]=
dup
키와 키는 어떤 이유에서 참조 할 수 없습니다. 관찰
puts object.keys
반환
undefined method `keys' for nil:NilClass
puts object.key
반환
undefined method `key' for #<Hash:0x103aeb0b0>
솔루션 : 너희들거야 시간입니다 이것을 먹었다. 실행하여 문제를 해결했습니다.
농담이 아닙니다. 루비 1.8.7을 1.8.7로 업데이트했습니다. 문제 해결됨. 내 루비 설치에 미친 짓은 한 번도 해본 적이 없지만, 거기에는 뭔가가 해시를 망쳐 놓은 것처럼 보입니다. 또는 아마도 매우 드문 버그 였을 것입니다. 이 문제를 일으킨 업데이트 추적에서 나는 아무것도 찾을 수 없습니다. 도와 주신 모든 분들께 감사드립니다.
당신은 그것을 모릅니다. 키 – OVERTONE
난 당신이 여기에 대한 답이 무엇을 찾고 있는지 생각하는 바로 거기에있다 : [루비 - 변수의 이름을 가져 오기] [1] [1] : HTTP : // 유래.COM/질문/58482/루비 얻을-A-변수 이름 –
을 내가 여기에 대한 답이 무엇을 찾고 있는지 생각 : 루비 - 변수의 이름을 가져 오기] [1] [1] http://stackoverflow.com/questions/58482/ruby-get-a-variables-name –